mvn上传pom/jar至Nexus私服

  • 上传jar文件
mvn deploy:deploy-file -Dfile={file} -DrepositoryId={repositoryId} -Durl={url} -DpomFile={pom} -Dpackaging=jar
eg:
mvn deploy:deploy-file -Dfile=xxx.jar -DrepositoryId=tbsnexus -Durl=http://xxx/nexus/content/repositories/repository -DpomFile=xxx.pom -Dpackaging=jar
  • 上传pom文件
mvn deploy:deploy-file -Dfile={file} -DrepositoryId={repositoryId} -Durl={url} -DpomFile={pom} -Dpackaging=pom
eg:
mvn deploy:deploy-file -Dfile=xxx.pom -DrepositoryId=tbsnexus -Durl=http://xxx/nexus/content/repositories/repository -DpomFile=xxx.pom -Dpackaging=pom

报错记录

  • Cannot deploy artifact from the local repository

在这里插入图片描述
mavendeploy:deploy-file命令安装的jarpom位于本地repository的目录下时命令会出错 (Cannot deploy artifact from the local repository…),解决方法是将要安装的jarpom文件copy到其它目录再安装,只要不在本地仓库目录都可以

参考博客:jar包上传maven私服出错Cannot deploy artifact from the local repository
.end

原文地址:https://www.cnblogs.com/maggieq8324/p/14159051.html