Maven发布:准备失败,必须指定“scm connection或developerConnection”

问题描述 投票:25回答:3

我正在尝试使用mvn release:prepare准备我的maven项目的版本,但它失败并出现以下错误:

引起:org.apache.maven.plugin.MojoFailureException:缺少必需的设置:必须指定scm connection或developerConnection。

在maven.apache.org上阅读了这些设置后,我发现有SVN(版本控制)设置。但我没有使用版本控制。在这种情况下我应该如何制作maven? 我正在使用maven 3.0.3。

maven maven-release-plugin
3个回答
35
投票

如果您只想更改版本,Versions Maven Plugin可能会有所帮助。

versions:set可能是最好用的。

请大家注意,因为您没有使用SCM,请在使用以下命令之前进行完整备份。

mvn versions:set -DnewVersion=1.0 
mvn clean install
mvn versions:set -DnewVersion=1.1-SNAPSHOT 
mvn clean install

无论如何,我强烈建议并鼓励您使用SCM并按照Maven的良好做法执行发布。

我希望这可能有所帮助。


6
投票

可能你的pom.xml没有条目

    <scm>        
    <connection>scm:svn:https://host:port/abc/xyz/trunk</connection>
 <developerConnection>scm:svn:https://host:port/abc/xyz/trunk</developerConnection>
    </scm>

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <tagBase>https://host:port/abc/xyz/tag</tagBase>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                </plugin>               
            </plugins>
        </pluginManagement>
    </build> 

0
投票

在Spring Boot中,答案取决于您使用的插件

泊坞窗 - Maven的插件:

  • mvn docker:build

dockerfile - Maven的插件:

  • mvn dockerfile:build

我希望这对你有帮助

问候

© www.soinside.com 2019 - 2024. All rights reserved.