“您在反应堆项目列表中没有SNAPSHOT项目。” 使用Jenkins Maven发布插件时


105

我在最新版本的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片段,其中项目获得了它的版本-它是从父项继承来的

    <parent>
            <artifactId>subco</artifactId>
            <groupId>org.mainco.subco</groupId>
            <version>52.0.0</version>
    </parent>

2
什么version是你的pom.xml
MariuszS

Answers:


156

您正在尝试发布不是快照的工件。这意味着工件的版本号约为3.0.3。该版本号表示它已经发布。您无法发布版本。两者之间没有变化,因此没有意义。

您只应发布SNAPSHOT版本。这意味着您的版本号应为3.0.3-SNAPSHOT。


1
我添加了如何获取版本-我是从父pom继承它。可悲的是,如果我更改版本以包含“ -SNAPSHOT”,则会收到错误消息:“无法在项目myproject上执行目标org.apache.maven.plugins:maven-release-plugin:2.0:prepare(default-cli):可以由于未发布依赖项而无法发布项目”
Dave

@戴夫我想你也必须给父母做个快照。
Daniel Kaplan

我可能需要打开第二个SO问题,但父pom确实具有SNAPSHOT版本,尽管它是“ 53.0.0-SNAPSHOT”(而不是我尝试从中继承的52.0.0-SNAPSHOT) 。您是指在父pom中更改版本吗?
戴夫

1
我认为错误消息不是自我解释的,除非您知道“反应器项目列表”的含义。感谢您的明确答复。

10
如果他们只添加诸如“您无法发布发行版”之类的消息,将会更容易理解。他们想到的消息是“反应堆项目列表中没有SNAPSHOT项目”。...谁会以这种方式解释此消息?
seba.wagner,2015年

8

Jenkins工作区未清理或FINAL内部有版本pom.xml。詹金斯(Jenkins)具有退房策略,用于清理工作区。

更多:Maven发布插件-需要SNAPSHOT项目

退房策略选项:

  • 通过首先删除未版本控制的文件/忽略的文件以及被忽略的文件/目录svn:ignore,然后执行来模拟干净签出svn update
  • 总是签出新副本
  • svn update尽可能多地使用,与svn revert更新之前

“ Jenkins有清理工作空间的选项”是什么意思?这些选项在哪里?您是否在谈论Jenkins的工作区清理插件?
戴夫

退房策略选项
MariuszS

1
对我来说,就是这样,在清除了詹金斯工作区之后,它开始起作用了。
rbhawsar

1

将您的Project POM文件从先前构建的代码库弹出到新版本。

1.0.1快照<version>1.0.1-SNAPSHOT</version>


0

将签出策略更改为“通过先删除未版本控制的文件/忽略的文件,然后进行svn更新来模拟干净的签出”,这对我来说很有效。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.