关于您无权运行分析的问题,请联系sonarqube maven中的项目管理员

fnvucqvd  于 2023-08-03  发布在  Maven
关注(0)|答案(1)|浏览(224)

有人遭受这个问题吗?当我尝试运行此命令时:

mvn clean verify sonar:sonar -Dsonar.projectKey=<ProjectName> -Dsonar.host.url=http://localhost:9000 -Dsonar.login=<AuthenticationKey>

字符串
结果是错误:你无权进行分析。请联系项目管理员
但是把它改成

mvn clean verify sonar:sonar -D sonar.projectKey=<ProjectName> -D sonar.host.url=http://localhost:9000 -D sonar.login=<AuthenticationKey>


它运行得很好。
我不知道这是不是一个问题?有人能解释一下吗?谢谢命令完全是从声纳上抄来的

628mspwn

628mspwn1#

从SonarQube生成的代码给了我同样的问题,加上我有很多:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project <project.name>: You're not authorized to run analysis. Please contact the project administrator. -> [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/MojoExecutionException
-D : The term '-D' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and     
try again.
At line:2 char:3
+   -D sonar.projectKey=<project.key> \
+   ~~
    + CategoryInfo          : ObjectNotFound: (-D:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
-D : The term '-D' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and     
try again.
At line:3 char:3
+   -D sonar.host.url=http://localhost:9000 \
+   ~~
    + CategoryInfo          : ObjectNotFound: (-D:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
-D : The term '-D' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and     
try again.
At line:4 char:3
+   -D sonar.login=<sonar.login>
+   ~~
    + CategoryInfo          : ObjectNotFound: (-D:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

字符串
但是在把所有内容放在一行中,删除" \ "加上在" -D sonar "之间有一个空格,一切都工作正常。

相关问题