[英]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-插件:
dockerfile-maven-插件:
我希望这对你有帮助
问候
您需要添加 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.