maven-release-plugin将快照部署到archiva

Tar*_*tor 3 maven maven-release-plugin

我如何强制mvn发布:执行部署到我的发布而不是我的快照存储库?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>
Run Code Online (Sandbox Code Playgroud)

Tar*_*tor 8

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

<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>
Run Code Online (Sandbox Code Playgroud)

我在这里找到了解决方案:mvn release:准备不对pom.xml提交更改

你可以在这里找到一个有效的例子:https://github.com/tarator/releaseplugintest