【发布时间】:2013-10-14 17:26:23
【问题描述】:
我使用的是versions-maven-plugin 的2.1 版本。
我有一个如下所示的源代码树:
+-- JavaProjects
+-- customs-deployment-support
+-- pom.xml
+-- pom.xml (a.k.a. base-parentpom)
+-- Projects
+-- customs-template
+-- pom.xml
+-- customs-ear-template
+-- pom.xml
+-- customs-rpm-template
+-- pom.xml
+-- customs-site-template
+-- pom.xml
+-- pom.xml (a.k.a. customs-parentpom)
现在上面,customs-template 项目的<parent /> 是customs-deployment-support。所有其他customs-*-template 项目的<parent /> 是base-parentpom。
注意:customs-parentpom 只是一个“聚合器”,并不是任何海关模块的真正父级,但它确实在其<modules /> 部分中将每个customs-* 项目声明为<module />。
对于SNAPSHOT 版本的构建,这很好用。
现在,我想转到 versioned 工件,其中每个工件的版本签名类似于 x.x.x_yyyyMMddhhmm_nn。
所以,现在我想使用versions-maven-plugin 来构建customs-parentpom(或“聚合器”pom.xml)
我使用 Jenkins 进行构建。因此,我配置了一个前置步骤,以在每个海关项目的 <parent /> 部分中调整版本,例如:
mvn versions:update-parent
我希望它找到 Nexus 中可用的最新上游工件(即 base-parentpom 和 customs-parentpom)。
但它失败了......
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]
[ERROR] The project com.etse:etse-customs-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-customs-deployment-support:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-ear-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-ear-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-rpm-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-rpm-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-site-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-site-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
考虑到在上述情况下,我从不希望 Jenkins 生成 SNAPSHOT 版本工件。我意识到 SNAPSHOT 在本地 .m2 存储库中不可用。我(真的)需要一个才能正确解析版本插件吗?
我做错了什么?甚至有可能做我想做的事吗?如果有帮助,我愿意分享 pom.xml 文件。
【问题讨论】:
标签: java maven-3 parent multi-module versions-maven-plugin