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.


We also have scheduled tasks in Nexus that periodically run to rebuild the
metadata and the indexes, mainly due to
the level of activity we see.


Hope this helps illustrates a little better what I am running into.


cheers,

     mehul



On Thu, Aug 3, 2017 at 3:19 AM, Yaron Golan <ygo...@interwise.com> wrote:

> The issue of getting the correct version when downloading is what written
> in the pom.xml file.
> It has nothing to do with whatever version you uploaded.
>
>
> Yaron Golan
>
>
> -----Original Message-----
> From: Mehul Sanghvi [mailto:mehul.sang...@gmail.com]
> Sent: Wednesday, August 02, 2017 7:28 PM
> To: ML Maven Users
> Subject: Maven not getting latest artefact after deploy:deploy-file
>
> Maven: 3.3.3
> Nexus: OSS 2.14.0-1
>
> We have a build process that explicitly uploads a few artefacts using
> deploy:deploy-file.  Subsequent builds in the chain, will than download
> these artefacts, but they never end up getting the latest artefact from
> Nexus.
>
> We can see the artefact is available in Nexus, but I always have to do a
> manual rebuilding of the metadata in Nexus before I am able to have the
> subsequent builds pick up the latest version.
>
> Here is what we use for uploading with deploy:deploy-file:
>
> ${mvn} deploy:deploy-file -B -V --quiet -s ${settings_file}
> -P${mvn_profile} ${maven_options} ${deploy_file_options}
> -DrepositoryId=${repo_id} -Durl=${repo_url} -DgroupId=${group_id}
> -Dversion=${version} -DartifactId=${artifact_id} -Dfile=${artefact}
>
> The above is run in a bash for-loop after the variables are setup via a
> case-esac statement.
>
>
> For downloading it is just "mvn clean install -B -V -U" followed by
> locations for security settings file and maven local repo.
>
>
>
> Any thoughts or suggestion ?   Let me know if more information is required.
>
> cheers,
>
>      mehul
>
>
> --
> Mehul N. Sanghvi
> email: mehul.sang...@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>



-- 
Mehul N. Sanghvi
email: mehul.sang...@gmail.com

Reply via email to