maven手动安装远程仓库中找不到的jar到本地仓库

www.allocmem.com · · 6123 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

只需要使用一个maven命令即可: mvn install:install-file -Dfile=(jar本地地址)/root/IdeaProjects/keta-customer/lib/patchca-0.5.0.jar -DgroupId=com.github.bingoohuang(groupId) -DartifactId=(artifactId)patchca -Dversion=(version)0.5.0 -Dpackaging=jar 即可利用pom像普通情况一样使用,在项目里自由使用了

后来因需安装bairong jar 使用命令: mvn install:install-file -Dfile=/Users/daniel/Desktop/bsApi-2.3.5-shaded.jar -DgroupId=bairongapi -DartifactId=bsApi -Dversion=2.3.5 -Dpackaging=jar -DgeneratePom=true mvn install:install-file -Dfile=/Users/daniel/Desktop/bsApi-2.4.0-shaded.jar -DgroupId=bairongapi -DartifactId=bsApi_test -Dversion=2.4.0 -Dpackaging=jar -DgeneratePom=true mvn install:install-file -Dfile=//Users/cool/work/lib/jaxb-api-2.2.jar -DgroupId=jaxb-api -DartifactId=javax-jaxb-api -Dversion=2.2 -Dpackaging=jar -DgeneratePom=true 期间报错: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: Error installing artifact ‘bairongapi:bsApi_test:jar’: Failed to install artifact bairongapi:bsApi_test:jar:2.4.0: /home/zhoudazhuang/repository/bairongapi/bsApi_test/2.4.0/bsApi_test-2.4.0.jar (权限不够) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 于是使用-e参数: mvn install:install-file -e -Dfile=/home/zhoudazhuang/zhaolei/bsApi-2.4.0-shaded.jar -DgroupId=bairongapi -DartifactId=bsApi_test -Dversion=2.4.0 -Dpackaging=jar -DgeneratePom=true 得到提示: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: Error installing artifact ‘bairongapi:bsApi_test:jar’: Failed to install artifact bairongapi:bsApi_test:jar:2.4.0: /home/zhoudazhuang/repository/bairongapi/bsApi_test/2.4.0/bsApi_test-2.4.0.jar (权限不够) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: Error installing artifact ‘bairongapi:bsApi_test:jar’: Failed to install artifact bairongapi:bsApi_test:jar:2.4.0: /home/zhoudazhuang/repository/bairongapi/bsApi_test/2.4.0/bsApi_test-2.4.0.jar (权限不够) 于是切至root,成功install

本文来自:www.allocmem.com

感谢作者:www.allocmem.com

查看原文:maven手动安装远程仓库中找不到的jar到本地仓库

6123 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传