1

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

FreshMike
  • 481
  • 1
  • 6
  • 26
  • 2
    Adding the version number to the jar is the usual way you handle jars in maven. Nexus (and also Maven Central) store the jars in this way, too. Why do you want to avoid this? – J Fabian Meier Aug 12 '16 at 13:14
  • How did you downloaded artifact without version? I open first page http://mvnrepository.com/artifact/org.uberfire/uberfire-commons/0.9.0.Beta1 and I see (after clicking link to repository central) files with version. Anyway, you should rather explain what you want to get rather to ask how to modify Archiva storage logic – michaldo Aug 17 '16 at 15:08
  • +1 : It is a valid question and I faced the same problem. @michaldo: There are many use cases where you want to just keep the name of the file(without its version). I had to do the same while downloading files from archiva for my puppet module. – Atmesh Mishra Aug 30 '16 at 09:48
  • 1
    @AtmeshMishra thanks for clarification. I proposed 2 solutions as answer – michaldo Aug 31 '16 at 09:42

1 Answers1

2

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

Community
  • 1
  • 1
michaldo
  • 4,195
  • 1
  • 39
  • 65