Issue
I want to publish my project's artefact .jar to my nexus repository. However the maven deploy
plugin always includes a timestamp suffix to the deployed artefact. I followed the documentation to omit the suffix but nothing works - it's still adding it.
The documentation states that <uniqueVersion></uniqueVersion>
should be set to false
which I did in the pom.xml
for every repository configuration and I also used it as a flag like so mvn deploy -DuniqueVersion=false
. However nothing works.
The result in Nexus always has the mentioned suffix
Here is my pom.xml
:
<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>com.company.tools</groupId>
<artifactId>com.company.tools.myTool</artifactId>
<version>1.3-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.10</version>
</dependency>
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<version>9.4</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>Corporate Repository</name>
<url>http://192.168.141.10:8081/repository/maven-releases/</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>Corporate Snapshots</name>
<url>http://192.168.141.10:8081/repository/maven-snapshots/</url>
<layout>legacy</layout>
</snapshotRepository>
</distributionManagement>
</project>
Any idea what I am missing or misunderstanding here?
Solution
Support for <uniqueVersion></uniqueVersion>
was deprecated in Maven 2.x, and removed entirely in Maven 3. So this is not expected to work, unless you are using the EOL Maven 2. See “major version upgrade to version 3.0” here:
https://maven.apache.org/plugins/maven-deploy-plugin/
Answered By - rseddon
Answer Checked By - Marilyn (JavaFixing Volunteer)