nexus 3.x上传本地jar

今天碰到需要上传非maven管理的jar到nexus,记录下。语法如下:

1
2
3
4
5
6
7
8
mvn deploy:deploy-file 
-DgroupId=<group-id>\
-DartifactId=<artifact-id>\
-Dversion=<version>\
-Dpackaging=<type-of-packaging>\
-Dfile=<path-to-file>\
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml>\
-Durl=<url-of-the-repository-to-deploy>

举一个简单的栗子:

1
2
3
4
5
6
7
mvn deploy:deploy-file 
-DgroupId=lt.jave
-DartifactId=jave
-Dversion=1.0.2
-Dfile=jave-1.0.2.jar
-DrepositoryId=nexus
-Durl=http://localhost:8081/repository/maven-releases/

DrepositoryId=nexus指的是setting配置的验证的id

坚持原创技术分享,更多深度分析、实践代码,您的支持将鼓励我继续创作!