Maven / Nexus not picking up the latest version of SNAPSHOT artefact

1,273 views
Skip to first unread message

Mehul Sanghvi

unread,
Aug 23, 2017, 2:02:55 PM8/23/17
to nexus...@glists.sonatype.com
Maven:  3.3.3
Nexus: 2.14.5-02


We have a product made up of several components:

   Comp1 -> Comp2 -> Comp3 -> Comp4 -> Product

That is the order of dependencies for the builds.  Each component uploads
some JARs to Nexus using Maven deploy:deploy-file.  What we are seeing
is that the latest artefacts that are uploaded to Nexus are not being
picked up by subsequent components and the product.  They are all
using -SNAPSHOT versions,  as they should be.  I will try to
illustrate with an example.

I have the following:

 Comp3-artefact-1.2.3.4.5-20170820-080555-18-all.zip
 Comp3-artefact-1.2.3.4.5-20170821-080423-19-all.zip
 Comp3-artefact-1.2.3.4.5-20170822-075728-20-all.zip
 Comp3-artefact-1.2.3.4.5-20170823-075717-21-all.zip

on my Nexus server, that I see using the web-ui.

When I build the Product, it should pick up the *-21-all.zip artefact
as that is the latest.  What happens though is that it picks up the
*-20-all.zip artefact.  I have to manually rebuild the metadata and
rebuild the index through the Nexus webui and than re-start the build
for it to pick up the latest version.

This is true regardless of what component it is, and also is showing up
in between the Components as well.

Is this an indexing issue ?  Is it in Maven or Nexus ?  And what
should I do to fix it ?



cheers,

       mehul

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

Rich Seddon

unread,
Aug 23, 2017, 2:18:17 PM8/23/17
to nexus...@glists.sonatype.com
What is the updatePolicy set to in your repository definition for snapshots in your settings.xml?  You should have it set to "always".


--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CAPo9-A8Th%2Ba6MF9o05NjCq1hoo%2B%3DUa2KTCO3queW16EZA7yEGA%40mail.gmail.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Mehul Sanghvi

unread,
Aug 23, 2017, 2:38:43 PM8/23/17
to Rich Seddon, nexus...@glists.sonatype.com
Rich,

    Yes sorry forgot to mention that the update policy is "always"


                <repository>
                    <id>snapshots</id>
                    <name>Internal Nexus Snapshots</name>
                    <url>http://nexus.mycorp.com:8081/nexus/content/groups/snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>

And here is a sample of the command being used for deploying the artefacts:


mvn deploy:deploy-file -B -V --quiet -s /path/to/settings.xml -PComp4-profile -Dmaven.repo.local=/path/to/repo-comp4-nightly -Dsettings.security=/path/to/settings-security.xml -DgeneratePom=true -Dclassifier=all -DrepositoryId=comp4-snapshots -Durl=http://nexus.mycorp.com:8081/nexus/content/repositories/comp4-snapshots -DgroupId=com.mycorp.mygroup -Dversion=1.2.3.4.5-SNAPSHOT -DartifactId=Comp4-artefact -Dfile=path/to/target/Comp4-artefact-1.2.3.4.5-SNAPSHOT-all.zip



cheers,

      mehul



Reply all
Reply to author
Forward
0 new messages