配置Setting.xml
<servers>
<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>
配置项目POM;发布
<!-- 定义snapshots库和releases库的nexus地址 -->
<distributionManagement>
<repository>
<!-- 库的id -->
<id>nexus-releases</id>
<!-- 库的url -->
<url>https://172.15.123.19:9298/nexus/maven/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://172.15.123.19:9298/nexus/maven/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
mvn deploy -Dmaven.test.skip=true
命令行直接发布
mvn deploy:deploy-file -DgroupId=com.xy.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar -Dfile=E:\ojdbc14.jar -Durl=https://172.15.123.19:9298/nexus/maven/repositories/snapshots/ -DrepositoryId=thirdparty
nexus上传