【问题标题】:Unable to find artifact when install maven安装maven时找不到工件
【发布时间】:2018-06-23 20:53:35
【问题描述】:

当我为一个项目安装 maven 时,在 bitbucket 网站和配置服务器 tomcat 中进行了克隆,然后出现以下错误。

    [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)

如何解决?

【问题讨论】:

  • 先构建 ch.smartlink:authconfig:jar:0.0.1-SNAPSHOT

标签: java spring maven tomcat dependencies


【解决方案1】:

正如错误消息所解释的,maven 无法在官方 maven 存储库中找到该工件。 您需要使用“mvn install:install-file”将它安装在本地存储库(~/.m2/repository)中,或者更好的是,告诉 maven 在哪里可以找到它,在您的 pom 文件中添加存储库标签。

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

【讨论】:

  • 最后我必须注释在文件 pom.xml 中添加插件 maven 的代码。不管怎样,谢谢你的建议
猜你喜欢
  • 1970-01-01
  • 2020-03-09
  • 2020-10-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多