0

I have several libraries which I've manually deployed to my Nexus repository using:

mvn deploy:deploy-file -Durl=[url] -DrepositoryId=[repoId] -Dfile=[filePath] -DgroupId=[gId] -DartifactId=[aid] -Dversion=[v] -Dpackaging=jar

I did this because they are legacy jars and quite a large amount of them for which I've automated the process.

The problem I'm having is in packaging a WAR. The dependencies come down just fine, but when the war is generated they have the version+timestamp appended to the end. I have several other projects where this doesn't appear to be the scenario - i.e., after multiple packagings and deployments to a given server the lib directory [for the project] contains:

[jar].[<version>-timestamp1].jar
[jar].[<version>-timestamp2].jar
[jar].[<version>-timestamp3].jar
[jar].[<version>-SNAPSHOT].jar     <== this entry alone would be ideal

Also, I'm not using any specific plugins just invoking:

clean package

Is it possible to eliminate the timestamp when packaging the war?

Floresj4
  • 110
  • 1
  • 1
  • 8

1 Answers1

2

You may need to ask yourself why you need to eliminate the timestamp.

If you just want to download the latest SNAPSHOT version, Nexus provides REST API to download latest SNAPSHOT artifact just directly using your snapshot version as version parameter, such as 1.0-SNAPSHOT. e.g.

http://<your-nexus>/service/local/artifact/maven/redirect?r=<your-repo>&g=<the-group>&a=<the-id>&v=1.0-SNAPSHOT

From the API doc, the version parameter can support LATEST, RELEASE and SNAPSHOT versions.

Version of the artifact (Required) Supports resolving of "LATEST", "RELEASE" and snapshot versions ("1.0-SNAPSHOT") too.

Furthermore, with timestamp each SNAPSHOT build has it's unique version, which gives you the chance to download a specified SNAPSHOT build such as v=1.0-20140822.145007-2.

If you want to limit the number of snapshots, you can take a look this one: How to limit number of deployed snapshots artifacts in Nexus?

Community
  • 1
  • 1
Wenbing Li
  • 12,289
  • 1
  • 29
  • 41
  • How would you manage the WEB-INF/lib over time? Maybe I'm trying to solve a problem that supports both development and production environments, when they should differ... – Floresj4 Aug 22 '14 at 01:08
  • You may open other question about managing WEB-INF/lib with more details. – Wenbing Li Aug 22 '14 at 03:00