我尝试在 Maven 配置为无法访问外部存储库的计算机上执行 mvn sonar:sonar
命令(实际上,情况并非完全如此,但它帮助我解释我的问题)。
所以目前,如果我运行此命令,我会收到以下错误:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.codehaus.mojo:sonar-maven-plugin' does not exist or no valid version could be found
我认为这意味着我的本地存储库中有一些不正确的元数据,因为我有一个[本地存储库]\org\codehaus\mojo\sonar-maven-plugin\1.0-beta-1
目录(当然里面有 JAR)。
你知道为什么我的命令失败吗?
技术信息:Maven 2.2.1、Java 1.6、Sonar 2.1.2
最佳答案
您是否尝试过常见问题解答中的建议:
The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
If you get this error message after launching the maven command line "mvn sonar:sonar" add the "-U" parameter to the command line. Maven will then update its local repository with the latest version of the Sonar Maven plugin.
If adding the "-U" parameter doesn't fix your issue, you've certainly encountered Maven bug MNG-4001. The only known workaround is to delete the org\codehaus\mojo directory in your local Maven repository. Of course, if your local Maven repository is synchronized with a repository manager like Nexus, this operation must be also done on the repository manager side.
关于maven-2 - 在没有外部访问的情况下执行 "mvn sonar:sonar",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3051816/