Maven release:prepare:由于您进行了本地修改,因此无法准备发布 [英] Maven release:prepare : Cannot prepare the release because you have local modifications

查看:290
本文介绍了Maven release:prepare:由于您进行了本地修改,因此无法准备发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了continentum的release:prepare阶段的问题,该阶段在scm-check-modifications步骤中失败,并显示错误:

I'm facing a problem with continuum's release:prepare phase which fails in scm-check-modifications step with error :

[错误] org.apache.maven.shared.release.ReleaseFailureException: 由于您进行了本地修改,因此无法准备发布: [pom.xml:modified]

[ERROR] org.apache.maven.shared.release.ReleaseFailureException: Cannot prepare the release because you have local modifications : [pom.xml:modified]

我做了什么:

  1. 我将所有更改(* .java和pom.xml)都提交给SVN
  2. 我在Continuum中构建了该项目
  3. 我启动了发行版的准备工作.

我知道scm-check-modifications调用ScmCheckModificationsPhase类,该类验证与SCM上的内容相比,没有本地更改.

I know that the scm-check-modifications calls ScmCheckModificationsPhase class that verifies that there are no local changes compared to what is on the SCM.

我了解我是否仅使用Maven,例如是否存在某些本地更改,或者本地代码与SVN之间存在任何差异,所以release:prepare不起作用,因为它首先检查修改;但是使用Continuum,我不知道为什么本地代码和SVN存储库之间应该有区别?所以我不知道为什么Continuum中的release:prepare目标面临着这个问题.

I understand if i'm working with only Maven, if there are some locally changes, or any differences between the local code and the SVN for example, release:prepare won't work, because it checks for modifications first; but working with Continuum,i don't know why it should be a differencse between the local code and the SVN repository ? So i don't know why the release:prepare goal in Continuum is facing that problem.

我的pom示例:

    <build>
      <plugins>
    ...
       <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
                <useReleaseProfile>false</useReleaseProfile>
          </configuration>
       </plugin>

    ...     
      </plugins>

    </build>


<scm>
  <connection>scm:cvs:ext:url:/var/cvs:application_name</connection>         <developerConnection>scm:cvs:ext:url:/var/cvs:application_name</developerConnection>
</scm>

.....
</project>

在父pom.xml中:

In the parent pom.xml:

...
    <pluginManagement>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.2.2</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <goals>deploy</goals>
            <arguments>-Prelease</arguments>
          </configuration>
        </plugin>
.....

有关信息,到目前为止,项目的构建和发布始终可以正常工作.

For information, the build and the release of the project is always working fine, until now.

有一个绕过解决方案可以解决我的问题,但我仍在寻求了解此问题的根源.

There is a Bypass solution that solved my issue but i still seeking to understand the origin of this problem.

旁路解决方案:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <version>2.2.2</version>
  <configuration>
    ...
    <checkModificationExcludes>
      <checkModificationExclude>pom.xml</checkModificationExclude>
    </checkModificationExcludes>
  </configuration>
</plugin>

推荐答案

我可以确认,添加插件或将其配置为排除pom.xml检查确实有效:

I can confirm, that adding the plugin or configuring it to exclude the pom.xml check did work:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <configuration>
    <checkModificationExcludes>
        <checkModificationExclude>pom.xml</checkModificationExclude>
    </checkModificationExcludes>
  </configuration>
</plugin>

这篇关于Maven release:prepare:由于您进行了本地修改,因此无法准备发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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