无法建立声纳项目。错误:找不到父:org.codehaus.sonar:声纳

时间:2013-07-29 21:32:19

标签: sonarqube sonar-runner

尝试使用声纳构建我们的Java应用程序进行分析。我们在防火墙后面,因此无法访问maven repo1。我们确实有第三方工件的内部公司Artifactory和我们当地东西的项目Artifactory。我是负责构建服务器的SCM人员,而不是开发人员。那说使用junit测试的应用程序构建良好。我们有两个目标清洁安装。声纳服务器是3.5.1,端口设置为8080而不是9000这是我们的pom。

    <profile>
        <id>sonarJsEnabled</id>
        <properties>
            <srcDir>src/main/static</srcDir>
            <sonar.exclusions>libs/**/*,DSTCore/**/*,test/**/*</sonar.exclusions>
            <maven.test.skip>true</maven.test.skip>
            <sonar.language>js</sonar.language>
            <sonar.branch>js</sonar.branch>

        </properties>
    </profile>

    <profile>
        <id>sonarHtmlEnabled</id>
        <properties>
            <srcDir>src/main/static</srcDir>
            <sonar.language>web</sonar.language>
            <sonar.branch>web</sonar.branch>                                
            <sonar.web.fileExtensions>html,xhtml,jspf,jsp</sonar.web.fileExtensions>
            <maven.test.skip>true</maven.test.skip>
        </properties>
    </profile>
<profile>
   <id>sonar</id>
   <activation>
      <activeByDefault>true</activeByDefault>
   </activation>
   <properties>
      <!-- SERVER ON A REMOTE HOST -->
      <sonar.host.url>http://10.226.xx.xx:8080</sonar.host.url>
   </properties>
</profile>

和此:

           <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>1.0-beta-2</version>
            </plugin>

我们添加声纳:声纳当我们手动或使用Bamboo构建时,我们得到此输出。

C:\ sonartest&gt; mvn声纳:声纳 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'sonar'. [INFO] org.apache.maven.plugins: checking for updates from EnterpriseArchitectureRepo [INFO] org.codehaus.mojo: checking for updates from EnterpriseArchitectureRepo [INFO] artifact org.codehaus.mojo:sonar-maven-plugin: checking for updates from EnterpriseArchitectureRepo [INFO] Ignoring available plugin update: 2.0 as it requires Maven version 3.0 [INFO] Ignoring available plugin update: 2.0-beta-2 as it requires Maven version 3.0 [INFO] Ignoring available plugin update: 2.0-beta-1 as it requires Maven version 3.0 [INFO] ------------------------------------------------------------------------ [INFO] Building fundTrader [INFO] task-segment: [sonar:sonar] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] [sonar:sonar {execution: default-cli}] [INFO] Sonar host: http://10.226.xx.xx:8080 [INFO] Sonar version: 3.5.1 [INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:3.5.1:sonar Downloading: http://repository.corp.net:8080/artifactory/libs-release/org/codehaus/sonar/sonar/3.5.1/sonar-3.5.1.pom [INFO] Unable to find resource 'org.codehaus.sonar:sonar:pom:3.5.1' in repository EnterpriseArchitectureRepo (http://repository.corp.net:8080/artifactory/libs-release) ... [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar

Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': Cannot find parent: org.codehaus.sonar:sonar for project: null:sonar-maven-plugin:maven-plugin:null for project null:sonar-maven-plugin:maven-plugin:null Unable to download the artifact from any repository

任何帮助都会有很大帮助。

1 个答案:

答案 0 :(得分:2)

我看起来找不到sonar-3.5.1.pom。考虑将Bintray的jcenter远程存储库添加到您的Artifactory(它具有比Maven Center更多的工件)。 最简单的方法是从repo.jfrog.org上的Artifactory实例import the jcenter configuration。 只需点击导入 - &gt;从加载的存储库配置列表中加载并选择jcenter