On 03-08-17 17:57, Mehul Sanghvi wrote:
I will do my best to illustrate with as simple an example as I can.
Hopefully I don't miss anything by simplifying it.


Project-A:
<groupId>com.my.dept</groupId>
<artifactId>dept-artefact</artifactId>
<version>11.3.0.1.0-SNAPSHOT</version>

The above is uploaded to Nexus using deploy:deploy-file


Project-B depends on Project-A artefact and so has the following in its POM
file.

<dependencies>
       <dependency>
             <groupId>com.my.dept</groupId>
             <artifactId>dept-artefact</artifactId>
             <version>11.3.0.1.0-SNAPSHOT</version>
       </dependency>
</dependencies>



Nexus is setup to keep the latest 5 versions of the SNAPSHOTS.
So I see the following before the upload:

com/my/dept/dept-artefact/11.3.0.1.0-SNAPSHOT/dept-artefact-11.3.0.1.0-<time-stamp>-5-all.zip
com/my/dept/dept-artefact/11.3.0.1.0-SNAPSHOT/dept-artefact-11.3.0.1.0-<time-stamp>-4-all.zip
com/my/dept/dept-artefact/11.3.0.1.0-SNAPSHOT/dept-artefact-11.3.0.1.0-<time-stamp>-3-all.zip
com/my/dept/dept-artefact/11.3.0.1.0-SNAPSHOT/dept-artefact-11.3.0.1.0-<time-stamp>-2-all.zip
com/my/dept/dept-artefact/11.3.0.1.0-SNAPSHOT/dept-artefact-11.3.0.1.0-<time-stamp>-1-all.zip

I have not shown the POM file and the MD5 and SHA1 files above, but they
also exist with similar names.

Now when I run Project-A, and it deploys a new build of the artefact to
Nexus, then from the above list of files the -1-all.zip file gets deleted,
  and a -6-all.zip file is added, which is the latest version.

When a build of Project-B is triggered, it will pick up the -5-all.zip
rather than the -6-all.zip.  I have to manually update
the metadata in order for Project-B to pick up the latest snapshot.

this reads like a bug in Nexus, or maybe it can't keep up.
there is no way to control nexus from mvn deploy unless you use a nexus specific plugin or extension. You may want to look into using an up-2-date Nexus, current is 2.14.5-02 and upgrading is only 10mins work




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to