Jenkins中的Maven构建中止了 [英] Maven build is aborted in Jenkins
问题描述
我是詹金斯的新手!我设法在詹金斯克隆了GIT中心仓库,现在试图在詹金斯建立获取的Maven项目.我从GITHUB提取了7个项目,它们相互依赖,即某些项目在其POM中为其他项目定义了依赖项.
I am new to jenkins! I managed to clone GIT hub repo in Jenkins and now trying to build the fetched maven projects in Jenkins. I have 7 projects fetched from GITHUB and they are dependent on each other, i.e. some of the projects have dependencies defined for other projects in their POM.
以下是我的Maven配置(抱歉,无法在此处发布图片,以粗体显示)
Below are my maven configuration (Sorry, couldn't post Image here, see in bold)
根POM myFirstProject/pom.xml
目标和选项干净软件包的安装
MAVEN_OPTS
MAVEN_OPTS
备用设置文件I
增量构建-仅构建更改的模块
Incremental build - only build changed modules
禁用自动工件存档
并行检查构建模块
使用私有Maven存储库 工作区本地策略
Use private Maven repository Strategy Local to the workspace
为每个失败的模块发送电子邮件
Send e-mail for each failed module
在Pom解析过程中解决依赖项已选中
Resolve Dependencies during Pom parsing checked
无头奔跑
在Pom解析过程中处理插件
Process Plugins during Pom parsing
使用自定义工作区
Maven验证级别默认
Maven Validation Level DEFAULT
Maven设置配置-选择-
Maven Settings Configs - select -
Maven全局设置配置¡-选择-
Maven Global Settings Configs ¡ - select -
I get following trace when I build this job:
< === [詹金斯远程处理能力] ===>频道已启动 尚未为Maven 3实现构建单个Maven模块! 已完成:已终止
<===[JENKINS REMOTING CAPACITY]===>channel started Building single Maven modules is not implemented for Maven 3, yet! Finished: ABORTED
我正在使用Maven 3.3
I am using Maven 3.3
正如您在列出的配置中所看到的,我正在为项目之一的POM.xml提供参考.根据我的理解,jenkins应该解析此xml并首先构建所有依赖项目.我不确定我的理解是否正确...如果错误,我将继续前进.是否可以按所需的构建依赖关系顺序为不同的项目创建不同的作业?笨拙地离开这里...谢谢
As u can see in the configuration listed, I am giving reference for one of the projects' POM.xml. As per my understanding jenkins should parse this xml and build all the dependent projects first. I am not sure if my understanding is correct or not...if it's incorrect- I am looking forward to know how to go ahead. Shall I create different jobs for different projects in the sequence of build dependency required? clueless to go from here... thanks
推荐答案
如果您有7个相互依赖的项目,那么您应该在jenkins中有7个不同的工作来全部构建它们并安装它们在jenkins本地Maven存储库中.通过选中Resolve Dependencies during Pom parsing
选项(如您已经做的那样),Jenkins将自动解决项目的构建顺序.
If you have 7 projects that depend on each other, you should have 7 different jobs in jenkins to build them all and to install them in the jenkins local maven repository. By checking the Resolve Dependencies during Pom parsing
option (as you do already), Jenkins will resolve automatically the build sequence of the projects.
这可能很无聊,特别是如果您计划添加更多的依赖项(但它仍然可能是正确的方法).
It could be pretty boring to do, especially if you plan on adding more dependencies (but it could still be the proper way to go).
一种替代方法是(假设您可以控制7个项目的存储库/结构/...)来创建一个父maven pom,将其全部构建在一起.在这种情况下,您可能会将所有项目移动到一个公用文件夹下(在jenkins中仅导入一个Git),但是如果您愿意(或出于某些原因)不这样做,则还可以在jenkins配置中定义多个存储库
An alternative would be (assuming you have control over the 7 projects repositories/structures/...) to create a parent maven pom that would build them all in one. In that case, you would probably move all the projects under a common folder (to have only one Git import in jenkins) but if you prefer (or have some reasons) not to do that, you can also define several repositories in the jenkins configuration.
这篇关于Jenkins中的Maven构建中止了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!