1
votes

When I deploy a snapshot version of my project to Nexus the filename is stored in the snapshots repository with a timestamp suffix as follows:

my-lib-0.0.1-20151209.150900-1.jar

This is what I expect.

At the same time my local repository is updated with the new version of the snapshot but without the timestamp suffix. What is stored there is:

my-lib-0.0.1-SNAPSHOT.jar

I'm new to Maven and Nexus and have been playing around with them for a couple of days. Previously, the local repo was being updated with the same filename as what was in the Nexus snapshots repository.

Which property controls this behaviour?

These are the settings in my pom:

<distributionManagement>
    <snapshotRepository>
        <id>snapshots</id>
        <url>http://nexus.bxd.com:8081/nexus/content/repositories/snapshots</url>
    </snapshotRepository>

    <repository>
        <id>releases</id>
        <url>http://nexus.bxd.com:8081/nexus/content/repositories/releases</url>
    </repository>
</distributionManagement>

These are my server settings in settings.xml:

<servers>
    <server>
        <id>snapshots</id>
        <username>deployment</username>
        <password>***</password>
    </server>

    <server>
        <id>releases</id>
        <username>deployment</username>
        <password>***</password>
    </server>
</servers>

UPDATE

I've noticed that if I delete my local repo and deploy my library then the local repo is updated with my-lib-0.0.1-SNAPSHOT.jar.

If I delete my local repo and build another library that depends on my-lib then the local repo is updated with my-lib-0.0.1-SNAPSHOT.jar and the latest timestamped version too.

1
Which version of Maven is this (more precisely)? Are you extending a parent? in the <snapshotRepository> add <uniqueVersion>true</uniqueVersion>.carlspring
Maven version 3.3.3. I'm not extending a parent. My understanding is that uniqueVersion is ignored in version 3.ksl
By default it's value is set to true, unless you're inheriting from some parent and that overrides it somehow. Have a look here: maven.apache.org/ref/3.2.3/maven-model/maven.html.carlspring
Thanks for pointing that out. Either way, are you extending from a parent, or not?carlspring

1 Answers

0
votes

This is expected behavior, if you're using the maven-assembly-plugin, or are altering the finalName of the artifact.