gpt4 book ai didi

maven-release-plugin 将快照部署到文件

转载 作者:行者123 更新时间:2023-12-01 09:27:06 28 4
gpt4 key购买 nike

如何强制 mvn release:perform 部署到我的版本而不是复制我的快照存储库? release:perform 始终部署 SNAPSHOT 版本。恕我直言,这毫无意义

我的 pom.xml 中有

<groupId>com.mydomain</groupId>
<artifactId>MyArtifactName</artifactId>
<version>1.0.6-SNAPSHOT</version>
<packaging>jar</packaging>


<name>MyArtifactName</name>
<url>http://maven.apache.org</url>
<distributionManagement>
<repository>
<id>central</id>
<url>http://repo.example.com/artifactory/libs-release-local</url>
<name>libs-release-local</name>
</repository>
<snapshotRepository>
<id>central</id>
<url>http://repo.example.com/artifactory/libs-snapshot-local</url>
<name>libs-snapshot-local</name>
</snapshotRepository>
</distributionManagement>
<scm>
<tag>HEAD</tag>
<url>http://git.example.com/someUser/myproject</url>
<connection>scm:git:git@git.example.com/someUser/myproject.git</connection>
<developerConnection>scm:git:git@git.example.com/someUser/myproject.git</developerConnection>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
</plugin>
</plugins>
</build>

最佳答案

我发现了问题:问题是,我需要更新 maven-scm-provider-gitexe 依赖项,对于 maven-release-plugin(版本2.4.2),使用 Git 作为 SCM 时:

<build>
<plugins>
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

我在这里找到了解决方案:mvn release:prepare not committing changes to pom.xml

您可以在此处找到一个工作示例:https://github.com/tarator/releaseplugintest

关于maven-release-plugin 将快照部署到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21512011/

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