org.sonarsource.sonarqube的pOM:sonar-check-api:jar:缺少7.0-SNAPSHOT,没有可用的依赖项信息

时间:2018-05-17 05:20:09

标签: java eclipse maven sonarqube

我是Sonar的新手。当我尝试使用此示例编写自定义规则时,我看到的依赖“sonar-plugin-api”是版本6.7。但我的声纳版本是7.0。我不知道有什么不同之处。所以我下载SonarSource 7.0来获取jar。但是当我构建Maven项目“sonar-plugin-api”时,我得到以下错误。

[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.0
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: windows-x86_64
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] --------------------------------------------------------------------- ---
[INFO] Building SonarQube :: Plugin API 7.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.sonarsource.sonarqube:sonar-check-api:jar:7.0- SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.sonarsource.sonarqube:sonar-duplications:jar:7.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.sonarsource.sonarqube:sonar-testing-harness:jar:7.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.468 s
[INFO] Finished at: 2018-05-16T18:41:47+08:00
[INFO] Final Memory: 9M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sonar-plugin-api: Could not resolve dependencies for project org.sonarsource.sonarqube:sonar-plugin-api:jar:7.0-SNAPSHOT: The following artifacts could not be resolved: org.sonarsource.sonarqube:sonar-check-api:jar:7.0-SNAPSHOT, org.sonarsource.sonarqube:sonar-duplications:jar:7.0-SNAPSHOT, org.sonarsource.sonarqube:sonar-testing-harness:jar:7.0-SNAPSHOT: Could not find artifact org.sonarsource.sonarqube:sonar-check-api:jar:7.0-SNAPSHOT -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

2 个答案:

答案 0 :(得分:0)

你在谈论哪个例子?

您的错误是您正在构建子模块而不构建SonarQube的所有模块。转到克隆根,然后执行mvn install

答案 1 :(得分:0)

好像你正在为项目添加错误的库。请参阅此Maven Sonar Api 并在pom文件中添加所需的依赖项版本,然后执行mvn clean install而不是添加jar文件。