使用maven命令进行打包,部署项目到远程仓库

如果要部署项目到远程仓库,

方法一:配置pom.xml:

<distributionManagement>   
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>Snapshots</id>
<name>Internal Snapshots</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
这时候用 mvn deploy就可以把项目发布至远程仓库里了

方法二:
部署jar至nexus命令:
mvn deploy:deploy-file -DgroupId=com.xxx.biz.common -DartifactId=xxxx -Dversion=1.0 -Dpackaging=jar -Dfile=e:\test.jar -Durl=[url] -DrepositoryId=[id]
应用示例:替换绿色部分即可
mvn deploy:deploy-file -DgroupId=com.xxxx.biz.common -DartifactId=biz-common -Dversion=1.2.4 -Dpackaging=jar -Dfile=C:test.jar -Durl=http://192.xxx.x.xx:8081/nexus/content/repositories/snapshots -DrepositoryId=nexus-snapshots

猜你喜欢

转载自www.cnblogs.com/coder-wzr/p/9984378.html
今日推荐