Maven: Why is the -SNAPSHOT suffix missing in the artifact file name?

My maven artifact is deployed to the Nexus snapshot repository. There it is stored in the correct directory, but its file names have the following pattern:

mylibrary-1.0-20130213.125827-2.jar

However, Maven cannot upload this snapshot. According to the error log, Maven seems to expect the following file name:

mylibrary-1.0-SNAPSHOT.jar

These are the repository settings in my pom:

<repositories>
    <repository>
        <id>mycompany-all</id>
        <url>https://servername/nexus/content/groups/mycompany/</url>
    </repository>
</repositories>

<distributionManagement>
    <repository>
        <id>mycompany-releases</id>
        <url>https://servername/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
        <id>mycompany-snapshots</id>
        <url>https://servername/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

Note: the nexus group includes both relay releasesand snapshots.

I did not configure these repositories in settings.xml- is this a problem? Or what else am I doing wrong?

+5
source share
2 answers

I did this by adding repositories in the settings.xmlfollowing way:

<repositories>
    <repository>
        <id>mycompany-releases</id>
        <url>https://servername/nexus/content/repositories/releases/</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>false</enabled></snapshots>
    </repository>
    <repository>
        <id>mycompany-snapshots</id>
        <url>https://servername/nexus/content/repositories/snapshots/</url>
        <releases><enabled>false</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>

jar SNAPSHOT . , Maven , , , (. ).

, pluginRepositories, Maven.

+6

, (mylibrary-1.0-20130213.125827-2.jar), . Maven 3 , Maven 2 , :

<distributionManagement>
  ...
  <snapshotRepository>
    ...
    <uniqueVersion>false</uniqueVersion>
  </snapshotRepository>
  ...
</distributionManagement>

, :

<dependency>
  <groupId>com.foo</groupId>
  <artifactId>mylibrary</artifactId>
  <version>1.0-20130213.125827-2</version>
</dependency>

, "":

<dependency>
  <groupId>com.foo</groupId>
  <artifactId>mylibrary</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>

.

+13

All Articles