nexus in docker
docker run -d --name my-nexus \
-v my-nexus-data:/nexus-data \
-p 8081:8081 -p 8082:8082 -p 8083:8083 \
sonatype/nexus3:3.0.0
open http://127.0.0.1:8081
# admin / admin13
pom.xml
<distributionManagement>
<snapshotRepository>
<id>docker-nexus-snapshots</id>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>docker-nexus-releases</id>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>releases</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>docker-nexus-releases</serverId>
<nexusUrl>http://127.0.0.1:8081/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
settings.xml
<servers>
<server>
<id>docker-nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>docker-nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
release
./mvnw -s settings.xml -Preleases release:clean
./mvnw -s settings.xml -Preleases release:prepare
./mvnw -s settings.xml -Preleases release:perform
./mvnw -s settings.xml -Preleases deploy