Maven发布插件-需要SNAPSHOT项目 [英] Maven release plugin - SNAPSHOT project needed

查看:108
本文介绍了Maven发布插件-需要SNAPSHOT项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jenkins 中的M2版本插件,该插件在内部调用 maven-release-plugin 2.3.2 ,而在构建时会抛出此错误: You don't have a SNAPSHOT project in the reactor projects list .问题是,我的项目poms 要做的版本为1.0.0-SNAPSHOT.我想念什么?

I am using the M2 release plugin from within Jenkins which calls the maven-release-plugin 2.3.2 internally and while building throws this error : You don't have a SNAPSHOT project in the reactor projects list. Problem is , my projects poms do have their version as 1.0.0-SNAPSHOT. What am I missing ?

com.abc.defcompany parent POM,而我只是为mvn releaseutils

<modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.abc</groupId>
        <artifactId>def</artifactId>
        <version>1.0.0</version>
    </parent>

    <groupId>com.abc.def</groupId>
    <artifactId>utils</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>utils</name>


是的,我已经完成了基本的Google + SO拖网,并且到处都指出我的POM应该使用SNAPSHOT作为版本,而该版本已经存在.除了我公司的父POM不是快照.这可能是原因吗?


And yes, I have done my basic Google + SO trawl and everywhere it points that my POMs should be having SNAPSHOT as the version , which is already there. Except that my company parent POM is not snapshot. Could that be the reason ?

推荐答案

我遇到了同样的问题,但是这些解决方案不起作用. 此博客发自Tomek Kaczanowski 撞到头上的指甲.

I had the same problem but these solutions didn't work. This blog post by Tomek Kaczanowski hit the nail on the head.

原因通常是Jenkins SVN策略设置为尽可能多地使用svn更新",这不会清理两次构建之间的构建工作空间.

The cause often is that the Jenkins SVN strategy is set to "use svn update as much as possible" which does not clean up the build workspace between builds.

当您尝试剪切发行版时,Jenkins将更新您的pom并创建一些临时文件.如果发行失败,则不会清除这些pom更新和临时文件.因此,当您修复pom并尝试重新构建时,由于这些时髦的工作区工件使Jenkins感到困惑,您会收到You don't have a SNAPSHOT project in the reactor projects list错误.

When you try to cut a release, Jenkins will update your pom and create some temporary files. If the release fails, these pom updates and temp files are not cleaned up. So then, when you fix the pom and try to rebuild, you get the You don't have a SNAPSHOT project in the reactor projects list error due to these funky workspace artifacts confusing Jenkins.

解决方案是更改您的Jenkins SVN策略.以下任何一项都可以工作:

The solution is to change your Jenkins SVN strategy. Any of the following should work:

  • 总是签出新副本
  • 通过首先删除未版本控制/忽略的文件,然后进行"svn更新",来模拟干净的结帐
  • 尽可能多地使用svn更新,并在更新前使用"svn恢复"

我还建议您清理一下Jenkins工作区,以确保您重新开始.

I'd also recommend you clear out your Jenkins workspace just to make sure you're starting fresh.

这篇关于Maven发布插件-需要SNAPSHOT项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆