Maven mvn 手工导入
mvn deploy:deploy-file -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=1.1.37
-Dpackaging=jar -Dfile=fastjson-1.1.37.jar
-Durl=http://localhost:8081/nexus/content/repositories/thirdparty/
-DrepositoryId=thirdparty
参数说明
参数 | 参数说明 | 参数样例 |
---|---|---|
deploy:deploy-file | 导入命令 | |
-DgroupId | Jar包名、Pom文件包名 | |
-DartifactId | Jar名称、Pom文件名称 | |
-Dversion | Jar 版本号、Pom版本号 | |
-Dpackaging | 文件类型 | jar/pom |
-Dfile | 导入文件路径 | |
-Durl | 私服仓库地址 | |
-DrepositoryId | 仓库ID 需要在配置文件中配置,用于账号识别认证 | 参见下文 |
- DrepositoryId 在setting servers中配置,示例如下:
<servers>
<server>
<id>repository</id>
<username>zhuyuan</username>
<password>123456</password>
</server>
</servers>
异常说明
-Cannot deploy artifact from the local rep ository
需要将jar/pom文件转移到非仓库地址。
-Failed to transfer file xxx with status code 400
快照版本不可以上传到发布版仓库,发布版本不可以上传到快照版本。