簡體   English   中英

Maven 發布:准備失敗並顯示“必須指定 scm 連接或 developerConnection”

[英]Maven release:prepare fails with "scm connection or developerConnection must be specified"

我正在嘗試使用mvn release:prepare准備發布我的 Maven 項目,但它失敗並出現以下錯誤:

引起:org.apache.maven.plugin.MojoFailureException:缺少必需的設置:必須指定 scm 連接或 developerConnection。

在 maven.apache.org 上閱讀這些設置后,我看到有 SVN(版本控制)設置。 但我沒有使用版本控制。 在這種情況下,我應該如何發布 Maven 版本?
我正在使用 Maven 3.0.3。

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

版本:集可能是最好的使用。

請注意,由於您沒有使用 SCM,請在使用以下命令之前進行完整備份。

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

無論如何,我強烈推薦並鼓勵您使用 SCM 並通過遵循 Maven 良好實踐來執行發布。

我希望這可能會有所幫助。

可能你的 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> 

在 Springboot 中,答案取決於您使用的插件

docker-maven-插件:

  • mvn docker:build

dockerfile-maven-插件:

  • mvn dockerfile:build

我希望這對你有幫助

問候

您需要添加 SCM 配置。 在下面的示例中,我將我的 git 存儲庫添加到 master 分支

<scm>
    <developerConnection>
        scm:git:git@github.com:tufac2/sfg-pet-clinic.git
    </developerConnection>
</scm>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM