Mvn release: run does not deploy release version

I would like to use the maven-release plugin in my project. I have a maven repository called Artifactory. I can use mvn release: make and mvn release: do it well, but I don’t understand why deploy the artifact to libs-snapshot-local and not libs-release-local .

settings.xml

<server>
    <id>local-artifactory</id>
    <username>user</username>
    <password>password</password>
</server>
...
<mirror>
  <id>local-artifactory</id>
  <mirrorOf>*</mirrorOf>
  <url>http://localhost:8081/artifactory/repo</url>
</mirror>

local maven parent

enter code here<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>examples</groupId>
<artifactId>local-maven-parent</artifactId>
<version>1</version>
<packaging>pom</packaging>

<repositories>
    <repository>
        <id>local-artifactory</id>
        <name>Local Central Repository</name>
        <url>http://localhost:8081/artifactory/repo</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

<distributionManagement>
    <repository>
        <id>local-artifactory</id>
        <name>Local Release Repository</name>
        <url>http://localhost:8081/artifactory/libs-release-local</url>
    </repository>
    <snapshotRepository>
        <id>local-artifactory</id>
        <name>Local Snapshot Repository</name>
        <url>http://localhost:8081/artifactory/libs-snapshot-local</url>
    </snapshotRepository>
</distributionManagement>

P-parent :

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>examples</groupId>
    <artifactId>local-maven-parent</artifactId>
    <version>1</version>
</parent>

<scm>
    <developerConnection>scm:git:git@local-scm:demo.git</developerConnection>
  <tag>HEAD</tag>

<artifactId>pom-parent</artifactId>
<version>1.0.11-SNAPSHOT</version>
<packaging>pom</packaging>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>default</id>
                    <goals>
                        <goal>perform</goal>
                    </goals>
                    <configuration>
                        <pomFileName>../${project.artifactId}/pom.xml</pomFileName>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

I want pom-parent - $ {version} to be displayed in libs-release-local .

+4
source share
1 answer

maven-deploy-plugin, .

- :

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <version>2.8.1</version>
    <configuration>
         <altReleaseDeploymentRepository>local-artifactory::default::http://localhost:8081/artifactory/libs-release-local</altReleaseDeploymentRepository>
    </configuration>
  </plugin>

: https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html

+1

Source: https://habr.com/ru/post/1527533/


All Articles