我正在使用2.1
.versions-maven-plugin
我有一个源代码树,如下所示:
+-- 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)
现在上面,<parent />
项目customs-template
的customs-deployment-support
. <parent />
所有其他customs-*-template
项目的base-parentpom
.
注意:这customs-parentpom
只是一个“聚合器”,并不是任何自定义模块的真正父级,但它确实在其部分中将每个customs-*
项目声明为 a 。<module />
<modules />
对于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
SNAPSHOT
考虑到我从不希望 Jenkins在上述情况下生成版本工件。我意识到 SNAPSHOT 在本地 .m2 存储库中不可用。我(真的)需要一个才能使版本插件正确解析吗?
我究竟做错了什么?甚至有可能做我想做的事吗?如果有帮助,我愿意分享 pom.xml 文件。