运行mvn clean install时出现以下错误
Missing:
----------
1) org.apache.maven.shared:maven-invoker:jar:2.0.6
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.maven.shared -DartifactId=maven-invoker -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.apache.maven.shared -DartifactId=maven-invoker -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4
2) org.apache.maven.shared:maven-invoker:jar:2.0.6
2) org.apache.maven.archetype:archetype-common:jar:2.0-alpha-4
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.maven.archetype -DartifactId=archetype-common -Dversion=2.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.apache.maven.archetype -DartifactId=archetype-common -Dversion=2.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4
2) org.apache.maven.archetype:archetype-common:jar:2.0-alpha-4
----------
2 required artifacts are missing.
for artifact:
org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4
from the specified remote repositories:
nexus (http://nexus.browsermob.com/content/groups/public/)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 23 14:16:32 EDT 2011
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
3 回答
这些工件在主maven存储库中可用:maven-invoker:2.0.6和archetype-common:2.0-alpha-4,它们应自动解析 .
您的问题是这个Nexus存储库:http://nexus.browsermob.com . 我无权访问它,但必须将其配置为代理maven central repository . 如果您是BrowserMob的员工,请询问负责Nexus服务器的人员 . 如果不是 - 只需从
pom.xml
或settings.xml
全局删除此存储库 . 您有可能成功构建项目 .看起来您正在使用的存储库(http://nexus.browsermob.com/content/groups/public/)不包含一些常见的maven插件 .
你有几个选择:
配置nexus.browsermob.com repo,以便它从maven central代理工件
将maven中央存储库添加到本地设置文件中
如果要转到选项2,请将其添加到设置文件的
<repositories>
部分(通常位于.m2/settings.xml
的主文件夹中):这进入
<pluginRepositories>
部分:只需将“http://nexus.browsermob.com/content/groups/public/”粘贴到您的Web浏览器中,然后查看其中的库列表 . 你会看到那里的 libraries are absent 或它们是 with different version numbers . (这很有可能 . )
灵魂是:
如果版本号不同,则更新pom.xml中与http://nexus.browsermob.com/content/groups/public/上的版本号相关的版本号 .
如果它们不存在,请联系服务器人员将该jar添加到存储库 .
玩得开心 .