项目,pom里配置
linux搭建可以参考http://www.mamicode.com/info-detail-1995783.html
<!-- 配置远程发布到私服,mvn deploy -->
<distributionManagement>
<repository>
<id>releases</id>
<name> Nexus Release Repository </name>
<url> http://192.168.80.128:8088/nexus/content/repositories/releases/ </url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name> Nexus Snapshot Repository </name>
<url> http://192.168.80.128:8088/nexus/content/repositories/snapshots/ </url>
</snapshotRepository >
</distributionManagement >
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus Plugin Repository</name>
<url>http://192.168.80.128:8088/nexus/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
=============================
maven 的 settings.xml文件配置
<profiles>
<profile>
<id>nexusProfile</id>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>http://192.168.80.128:8088/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<!-- 激活 -->
<activeProfiles>
<activeProfile>nexusProfile</activeProfile>
</activeProfiles>
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>