gpt4 book ai didi

Maven 发布 :prepare : Cannot prepare the release because you have local modifications

转载 作者:行者123 更新时间:2023-12-04 02:42:17 32 4
gpt4 key购买 nike

我正面临着 continuum 的发布问题:准备阶段在 scm-check-modifications 步骤中失败并出现错误:

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



我做了什么:
  • 我将所有更改(*.java 和 pom.xml)提交到 SVN
  • 我在 Continuum 中构建了该项目
  • 我启动了发布的准备工作。

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

    我知道如果我只使用 Maven,如果有一些本地更改,或者本地代码和 SVN 之间有任何差异,例如,release:prepare 将不起作用,因为它首先检查修改;但是使用 Continuum,我不知道为什么本地代码和 SVN 存储库之间应该有所不同?所以我不知道为什么 Continuum 中的 release:prepare 目标面临这个问题。

    我的 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 中:
    ...
    <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>
    .....

    有关信息,项目的构建和发布一直运行良好,直到现在。

    有一个绕过解决方案解决了我的问题,但我仍在寻求了解这个问题的根源。

    旁路解决方案:
    <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检查确实有效:

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

    关于Maven 发布 :prepare : Cannot prepare the release because you have local modifications,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16199154/

    32 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com