百姓网网站建设微信网站建设
目的:在自己的maven项目中,要把当前maven项目部署到maven私库,供其他人引入依赖使用。
首先要确保你当前能访问到你的私库,能拉私库的maven依赖即可。
maven部署命令:
mvn deploy:deploy-file -Dmaven.test.skip=true -DgroupId=com.xx -DartifactId=test-demo -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/Users/gen/code/back_code/test-demo/target/test-demo-1.0.0-SNAPSHOT.jar -Durl=http://192.168.1.204:4999/repository/maven-snapshots/ -DpomFile=/Users/gen/code/back_code/test-demo/pom.xml -DrepositoryId=nexus-snapshots
需要修改的地方
groupId: 组id,根据你的maven项目中的pom文件中的groupId标签来artifactId:根据你的maven项目中的pom文件中的artifactId标签来version:根据你的maven项目中的pom文件中的version标签来
<groupId>com.xx</groupId>
<artifactId>test-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
file:你所打包好的jar包的全路径url:私库的地址pomFile:本地的maven项目的pom文件地址:全路径repositoryId:打包到对应的远程私库的id
