【问题标题】:SonarQube authentication failure message during analysis分析期间 SonarQube 身份验证失败消息
【发布时间】:2017-04-27 16:27:55
【问题描述】:

我有一个想要使用 SonarQube 的 Java 7/Maven 3 项目。 由于 Java 7,我必须使用 sonar-maven-plugin 3.0.2。 尝试连接时出现 401 错误:

[错误] 无法执行目标 org.sonarsource.scanner.maven:sonar-maven-plugin: 项目 XXX 上的 3.0.2:sonar (default-cli):无法执行 SonarQube:无法从服务器下载库:url [YYY/sonarqube/batch_bootstrap/index] 返回的状态无效:[401] -> [帮助 1]

maven插件版本是这样固定在pom.xml中的

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>sonar-maven-plugin</artifactId>
  <version>3.0.2</version>
</plugin>

我将设置放在 settings.xml 中,就像在 SonarQube 示例中一样:

 <pluginGroups>
    <pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
 </pluginGroups>
 <profiles>
    <profile>
        <id>sonar</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
             <sonar.host.url>YYY</sonar.host.url>
            <sonar.login>MYUSER</sonar.login>
            <sonar.password>MYPASSWORD</sonar.password>
        </properties>
    </profile>
 </profiles>

我尝试使用的 SonarQube 版本是 5.6。我错过了什么?为什么我不断收到此错误? 我尝试了在我的机器上本地安装的旧版本(4.5.6)SonarQube,并且可以正常工作。 我输入的凭据肯定适用于 Web 面板,并且系统配置为接受来自匿名用户的测试,尽管我目前正在尝试的用户是管理员。 这真的是身份验证错误(例如,由于配置错误)还是 sonar-maven-plugin 3.0.2 无法与 SonarQube 5.6 通信?

【问题讨论】:

    标签: sonarqube sonarqube5.6


    【解决方案1】:

    这里发生了两件事:

    • 首先,sonar-maven-plugin 3.0.2 不能与 SonarQube 5.6 一起使用
    • 其次,SonarQube 5.6+ 需要 Java 8。

    所以用你喜欢的任何东西编译你的项目,但取消插件版本并使用 Java 8 运行分析。

    【讨论】:

    • 感谢您的反馈。我取消了插件版本,当然切换到了 JAVA8,我现在面临以下错误:[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar (default-cli)在 YYY 项目上:无法执行 SonarQube:无法从服务器下载库:url [XXX] 返回的状态无效:[401] -> [Help 1] 使用相同的(管理员!)凭据登录浏览器有效,强制身份验证甚至设置为 false。
    • 这是一个新问题 user3676773 :-)
    猜你喜欢
    • 2017-05-19
    • 1970-01-01
    • 2012-08-15
    • 2015-05-13
    • 1970-01-01
    • 2020-07-26
    • 2018-09-18
    • 2021-04-05
    • 2011-09-29
    相关资源
    最近更新 更多