首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试使用maven在本地存储库中安装jar时

尝试使用maven在本地存储库中安装jar时
EN

Stack Overflow用户
提问于 2015-06-23 06:10:59
回答 1查看 2.6K关注 0票数 1

我在我的Nexus中没有这个SFTP jar &我已经将它的依赖项添加到POM文件中,但是现在我想在我的本地存储库中安装这个JAR,以便在我的项目中使用它。但是,即使我打开了具有管理员权限的命令提示符,访问也被拒绝了。

代码语言:javascript
复制
 C:\Windows\system32>mvn install:install-file -DgroupId=org.springframework.integration -DartifactId=spring-integration-sftp -Dversion=4.1.5 -Dpackaging=jar -Dfile=C:\Repo
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] Installing C:\Repo to C:\Users\t868396\.m2\repository\org\springframework
\integration\spring-integration-sftp\4.1.5\spring-integration-sftp-4.1.5.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.827 s
[INFO] Finished at: 2015-06-23T11:02:52+05:00
[INFO] Final Memory: 15M/64M
[INFO] ------------------------------------------------------------------------
[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
 'org.springframework.integration:spring-integration-sftp:jar': Failed to instal
l artifact org.springframework.integration:spring-integration-sftp:jar:4.1.5: C:
\Repo (Access is denied) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-07 21:17:07

大多数情况下,-Dfile=your.jar是不正确的,请检查您的论点(FYI在您的帖子中被省略了)。

下面是一个示例:

代码语言:javascript
复制
mvn install:install-file -DlocalRepositoryPath=repo -DcreateChecksum=true 
 -Dfile=[your-jar] -Dpackaging=jar 
 -DgroupId=[...] -DartifactId=[...] -Dversion=[...]

请参阅:Can I add jars to maven 2 build classpath without installing them?

和:https://maven.apache.org/general.html#importing-jars

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30995100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档