Search code examples
javaapachemavenuploadarchiva

How to upload Jar to Archiva without having the Version number appended?


If I use the UI Console to add a jar file to our Apache Archiva Maven Repo the version number is added to the jar file, but that's not what we want. For example if you browse http://mvnrepository.com/ to get a jar to download the version is a sub folder and not attached to the jar file name.

As you can see below I'm trying to add a 3rd party Jar to the repo via the UI but the version gets attached to the name.

Collection: /com/microsoft/sqlserver/jdbc/sqljdbc41/4.1.5605.100
com/microsoft/sqlserver/jdbc/sqljdbc41 (Parent)


Name

Size (Bytes)

Last Modified

maven-metadata.xml 184   12/08/16 11:30 
maven-metadata.xml.md5 52   12/08/16 11:04 
maven-metadata.xml.sha1 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar 586192   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar.md5 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar.sha1 68   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom 417   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom.md5 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom.sha1 68   12/08/16 11:04 

Much obliged for any help. Mike


Solution

  • Archiva (and other repos) keeps artifacts and version is essential. So the question is badly formulated. There could be a question how to DOWNLOAD artifact without version (thanks to Atmesh Mishra).

    Solution 1 with Archiva API: How do I download programmatically a single artifact from apache archiva using REST?

    Solution 2 with maven dependency plugin: goal dependency:copy with option parameter stripVersion=true: http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html#stripVersion