为什么找不到有效版本的 maven-sonar-plugin?
Why valid version of maven-sonar-plugin couldn't be found?
我们使用的是 maven 2.2.1,兼容的 sonar-maven-plugin 是 1.0,Sonarqube 4.0
有时构建失败,当我们检查日志时,我们遇到了这个奇怪的错误
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.apache.maven.plugins: checking for updates from snapshots
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from snapshots
[INFO] artifact org.apache.maven.plugins:maven-sonar-plugin: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-sonar-plugin: checking for updates from snapshots
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
... 15 more
所以我们去了org/codehaus/mojo位置然后发现maven-metadata-central.xml有以下内容。
xml version="1.0" encoding="UTF-8"?
<metadata />
也就是说 xml 文件中没有提到 sonar-maven-plugin,前缀:sonar 等...
尝试执行以下操作:
我们在 xml 文件(中央和快照)中添加了那个(sonar-maven-plugin,前缀),保存并重新启动构建,然后构建成功了 2 天。
现在又出现同样的错误!!!
根据我的说法,一些 file/program 正在修改这个 xml 文件。
谁能告诉我正在修改 xml 的那个文件是什么?
还有为什么 xml 中的数据被删除了?每次触发工作时都会发生吗?
artifactory 和这个有关系吗?
提前致谢。
您肯定面临与 http://jira.codehaus.org/browse/MNG-4001 相关的问题(参见 Sonar FAQ [1])。
从 .m2 存储库以及下载它的远程存储库中删除 org/codehaus/mojo 目录。
http://comments.gmane.org/gmane.comp.java.sonar.general/5010
希望这对您有所帮助。
我们使用的是 maven 2.2.1,兼容的 sonar-maven-plugin 是 1.0,Sonarqube 4.0
有时构建失败,当我们检查日志时,我们遇到了这个奇怪的错误
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.apache.maven.plugins: checking for updates from snapshots
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from snapshots
[INFO] artifact org.apache.maven.plugins:maven-sonar-plugin: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-sonar-plugin: checking for updates from snapshots
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist or no valid version could be found
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
... 15 more
所以我们去了org/codehaus/mojo位置然后发现maven-metadata-central.xml有以下内容。
xml version="1.0" encoding="UTF-8"?
<metadata />
也就是说 xml 文件中没有提到 sonar-maven-plugin,前缀:sonar 等...
尝试执行以下操作:
我们在 xml 文件(中央和快照)中添加了那个(sonar-maven-plugin,前缀),保存并重新启动构建,然后构建成功了 2 天。
现在又出现同样的错误!!!
根据我的说法,一些 file/program 正在修改这个 xml 文件。
谁能告诉我正在修改 xml 的那个文件是什么?
还有为什么 xml 中的数据被删除了?每次触发工作时都会发生吗?
artifactory 和这个有关系吗?
提前致谢。
您肯定面临与 http://jira.codehaus.org/browse/MNG-4001 相关的问题(参见 Sonar FAQ [1])。
从 .m2 存储库以及下载它的远程存储库中删除 org/codehaus/mojo 目录。
http://comments.gmane.org/gmane.comp.java.sonar.general/5010
希望这对您有所帮助。