【问题标题】:Unable to build sonar project. Error: Cannot find parent: org.codehaus.sonar:sonar无法构建声纳项目。错误:找不到父级:org.codehaus.sonar:sonar
【发布时间】:2013-07-30 16:51:06
【问题描述】:

尝试使用声纳构建我们的 java 应用程序进行分析。我们在防火墙后面,因此无法访问 maven repo1。我们确实有一个用于第三方工件的内部公司 Artifactory 和一个用于我们本地产品的项目 Artifactory。我是负责我们构建服务器的 SCM 人,而不是开发人员。也就是说,带有 junit 测试的应用程序构建良好。我们有两个目标干净安装。声纳服务器是 3.5.1,端口设置为 8080 而不是 9000 这是在我们的 pom.xml 文件中。

    <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>

我们添加 sonar:sonar 当我们手动构建或使用 Bamboo 构建时,我们会得到这个输出。

C:\sonartest>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

任何帮助将不胜感激。

【问题讨论】:

    标签: sonarqube sonar-runner


    【解决方案1】:

    我好像找不到sonar-3.5.1.pom。考虑将 Bintray 的 jcenter 远程存储库添加到您的 Artifactory(它比 Maven Center 拥有更多的工件)。 最简单的方法是从 repo.jfrog.org 上的 Artifactory 实例发送 import the jcenter configuration。 只需点击 Import -> Load 并从已加载的存储库配置列表中选择 jcenter

    【讨论】:

    • 是的。现在明白了。谢谢。
    猜你喜欢
    • 2017-04-15
    • 2017-09-13
    • 1970-01-01
    • 2016-05-26
    • 2018-06-30
    • 1970-01-01
    • 1970-01-01
    • 2017-12-02
    • 1970-01-01
    相关资源
    最近更新 更多