How to configure maven project to deploy both snapshot and releases to Nexus?
<distributionManagement> <repository> <id>InternalReleases</id> <name>Internal Releases</name> <url>http://192.168.16.232:8081/nexus/content/repositories/releases/</url> </repository> <repository> <id>InternalSnapshots</id> <name>Internal Snapshots</name> <url>http://192.168.16.232:8081/nexus/content/repositories/snapshots/</url> </repository> </distributionManagement>
This configuration creates error in Eclipse 3.8 with m2e 1.2
Project build error: Non-parseable POM D:\Workspaces\W\Parent\pom.xml: Duplicated tag: 'repository' (position: START_TAG seen ...
I want the artifact deployed to the InternalSnapshots repository when the pom's version is suffixed with -SNAPSHOT and deployed to the InternalReleases repository when it is RELEASE. This should happen using the same pom.xml file and executing the same mvn deploy
command.
If you change the version of the asset you're deploying to include -SNAPSHOT it will automatically use the snapshot repository. For example 6.2. 0 will go to the release repo when you do mvn deploy or your release command.
By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don't care if you lose snapshots, but you will care if you lose releases. It makes snapshot cleanup much easier to deal with that way.
You need to distinguish between the releases and snapshots repository. <distributionManagement>
only allows one <repository>
and one <snapshotRepository>
child.
http://maven.apache.org/pom.html#Distribution_Management
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With