繁体   English   中英

安装Maven时找不到工件

[英]Unable to find artifact when install maven

当我为bitbucket网站和配置服务器tomcat中的克隆项目安装maven时,出现以下错误。

    [INFO] --- maven-dependency-plugin:2.10:copy (default) @ authconfig 
    [INFO] Configured Artifact: ch.smartlink:authconfig:0.0.1-SNAPSHOT:jar
    Downloading: http://central.maven.org/maven2/ [...private link]
    Downloading: http://central.maven.org/maven2/ [...private link]
   [INFO] BUILD FAILURE
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-
   dependency-plugin:2.10:copy (default) on project authconfig: Unable to 
   find artifact. Could not find artifact 
   ch.smartlink:authconfig:jar:0.0.1-SNAPSHOT in nexus 
   (http://central.maven.org/maven2/)
   [ERROR] Try downloading the file manually from the project website.
   [ERROR] Then, install it using the command:
   [ERROR] mvn install:install-file -DgroupId=ch.smartlink -
   DartifactId=authconfig -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -
   Dfile=/path/to/file
   [ERROR] Alternatively, if you host your own repository you can deploy 
   the file there:
   [ERROR] mvn deploy:deploy-file -DgroupId=... -DartifactId=authconfig -
   Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=
   [url] -DrepositoryId=[id]
   [ERROR] ...:authconfig:jar:0.0.1-SNAPSHOT
   [ERROR] from the specified remote repositories:
   [ERROR] nexus (http://central.maven.org/maven2/, releases=true, 
  snapshots=true)

如何解决?

如错误消息所解释,Maven在官方Maven存储库中找不到工件。 您需要使用“ mvn install:install-file”将其安装在本地存储库(〜/ .m2 / repository)中,或者最好告诉maven在pom文件中添加存储库标签的位置。

参见: https : //maven.apache.org/guides/introduction/introduction-to-repositories.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM