【问题标题】:Configuration of Maven profile to connect with SonarQube which is using LDAP配置 Maven 配置文件以连接使用 LDAP 的 SonarQube
【发布时间】:2017-06-19 16:31:27
【问题描述】:

如何配置 Maven 配置文件(在 settings.xml 文件中)以在 SonarQube 中创建报告,该报告使用 LDAP 对用户进行身份验证。 我想从我的本地机器执行一个 Maven 命令:

mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar -Psonar

如何修复配置文件“sonar”的用户和密码以通过 SonarQube 中的 LDAP 身份验证?

<profile>
    <id>sonar</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <sonar.host.url>http://some_url/sonar</sonar.host.url>
        <!--???---LDAP user configuration---???-->
        <sonar.scm.disabled>true</sonar.scm.disabled>
    </properties>
</profile>

【问题讨论】:

    标签: maven sonarqube maven-plugin


    【解决方案1】:

    您必须使用用户令牌而不是登录名和密码。这样更安全,因为您不会暴露密码,而且您可以随时撤销令牌。

    为此目的:

    1. 转到“我的帐户 > 安全”并在该页面上生成令牌
    2. 在您的 settings.xml 文件中添加以下属性:

      &lt;sonar.login&gt;123456abcdef&lt;/sonar.login&gt;

    【讨论】:

    • 这可行,但我没有全局权限“管理系统”权限(顺便说一句。我使用的是 5.1.0 版)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-13
    • 1970-01-01
    • 2014-05-25
    相关资源
    最近更新 更多