“在反应器项目列表中没有SNAPSHOT项目”。使用Jenkins Maven发布插件时
我正在使用最新版本的Jenkins和Maven Release插件上的SVN,Maven 3.0.3。 我试图使用Maven发布插件(通过jenkins)做一个干运行,所以在执行选项…
Executing Maven: -B -f /scratch/jenkins/workspace/myproject/myproject/pom.xml -DdevelopmentVersion=53.0.0-SNAPSHOT -DreleaseVersion=52.0.0 -Dusername=***** -Dpassword=********* -DskipTests -P prod -Dresume=false -DdryRun=true release:prepare
但是干运行正在死于下面的错误…
[JENKINS] Archiving /scratch/jenkins/workspace/myproject/myproject/pom.xml to /home/evotext/hudson_home/jobs/myproject/modules/org.mainco.subco$myproject/builds/2013-11-18_16-09-14/archive/org.mainco.subco/myproject/52.0.0/myproject-52.0.0.pom Waiting for Jenkins to finish collecting data mavenExecutionResult exceptions not empty message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list. cause : You don't have a SNAPSHOT project in the reactor projects list. Stack trace : org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.maven.Maven3Builder.call(Maven3Builder.java:129) at hudson.maven.Maven3Builder.call(Maven3Builder.java:67) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.maven.plugin.MojoFailureException: You don't have a SNAPSHOT project in the reactor projects list. at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:219) at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:181) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 30 more Caused by: org.apache.maven.shared.release.ReleaseFailureException: You don't have a SNAPSHOT project in the reactor projects list. at org.apache.maven.shared.release.phase.CheckPomPhase.execute(CheckPomPhase.java:111) at org.apache.maven.shared.release.phase.CheckPomPhase.simulate(CheckPomPhase.java:123) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:199) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103) at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:211) ... 33 more
我的SVN签出方法设置为“总是签出新鲜的副本”,我的快照存储库中有问题的快照版本,但不是在我的发布版本库中。 有没有办法让我的“反应堆项目列表”看看我的快照回购?
编辑:我包括我的POM的项目得到它的版本的片段 – 它从父母inheritance
<parent> <artifactId>subco</artifactId> <groupId>org.mainco.subco</groupId> <version>52.0.0</version> </parent>
您试图释放不是快照的工件。 这意味着你的工件的版本号是3.0.3。 该版本号意味着它已经被释放。 你不能释放一个版本。 两者之间不会有任何变化,因此没有意义。
你只应该发布SNAPSHOT版本。 这意味着你的版本号会像3.0.3-SNAPSHOT。
Jenkins工作区不是清理,或者你在pom.xml
有FINAL
版本。 jenkins有清理工作空间的退房策略。
更多: Maven发布插件 – 需要SNAPSHOT项目
退房策略选项:
- 首先删除未版本控制的文件/被忽略的文件,以及被
svn:ignore
文件/目录,然后执行svn update
模拟clean checkout。 - 总是检查新鲜的副本
- 尽可能使用
svn update
,svn revert
在更新之前svn revert
改变检出策略为“通过首先删除未版本化的文件/忽略的文件,然后svn更新模拟清理结帐”为我做了诡计。