创建maven项目,想要上传的nexux上,用于其它maven项目使用
1,在要上传的maven项目的pom.xml配置文件中,添加
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://192.168.183.130:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://192.168.183.130:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
repository 是上传Release 版本的jar包,snapshotRepository是上传snapshot的jar包
其中两个 id 的值 (nexus-releases,nexus-snapshots) 是在maven_home\conf\settings.xml配置文件中 services 配置的id
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
2,以上配置完成以后,点击eclipse run as --- > maven build--> deploy,如果控制台输出 不利的success,则表示发布成功