【问题标题】:maven-release-plugin deploys snapshot to archivamaven-release-plugin 将快照部署到档案
【发布时间】:2014-02-26 00:47:44
【问题描述】:

如何强制 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>

【问题讨论】:

  • 你的pom.xml的分发管理是否正确? maven.apache.org/pom.html#Repository
  • 工件的名称和版本是什么?
  • 我编辑了上面的问题。
  • 您对快照和发布存储库使用相同的&lt;id&gt;。会不会是这个问题?
  • @Stefan Ferstl:不,这也没有帮助。即使使用不同的 ID 运行 'mvn release:perform' 总是部署到 SNAPSHOT 存储库......烦人......不知何故......

标签: maven maven-release-plugin


【解决方案1】:

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

<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

【讨论】:

  • 今天你是我的英雄。
猜你喜欢
  • 2011-06-10
  • 2015-02-21
  • 2011-01-15
  • 1970-01-01
  • 2011-11-12
  • 2015-10-06
  • 1970-01-01
  • 2021-10-28
  • 2012-02-02
相关资源
最近更新 更多