我的配置是:SonarQube 4.0
,Build Stability 1.2
, Jenkins 1.549
。聲納構建穩定性插件403錯誤
我配置上項目級別構建穩定性插件(配置 - >設置):
- 進入我的登錄信息(這是絕對正確的)
- 進入了我的密碼(這絕對是正確的)
- 進入CI網址:
Jenkins:https://<host>/job/<job-name>/
(其中<host>
和<job-name>
與實際主機和實際作業名稱代替) - 指定的兩個屬性在我的聲納分析運行配置:
-Dsonar.login=admin -Dsonar.password=admin
(如描述的here)。這些憑據絕對正確。
我通過Web界面訪問這個工作還有REST API:https://<host>/job/<job-name>//lastBuild/api/xml/
返回200
但是當我運行聲納分析,我得到:
[INFO] [23:27:04.986] CI URL: Jenkins:https://<host>/job/<job-name>/
[ERROR] [23:27:06.017] Received 403 when trying to access https://<host>/job/<job-name>//lastBuild/api/xml/
org.sonar.api.utils.SonarException: Received 403 when trying to access https://<host>/job/<job-name>//lastBuild/api/xml/
at org.sonar.plugins.buildstability.ci.CiConnector.execute(CiConnector.java:132) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.executeGet(CiConnector.java:120) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.getLastBuild(CiConnector.java:68) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.getBuildsSince(CiConnector.java:106) ~[na:na]
at org.sonar.plugins.buildstability.BuildStabilitySensor.analyse(BuildStabilitySensor.java:105) ~[na:na]
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72) [sonar-batch-4.0.jar:na]
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:190) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:185) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:178) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:58) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:155) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:143) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74) [sonar-batch-4.0.jar:na]
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45) [sonar-runner-batch7469182442801630044.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-runner-api-2.3.jar:na]
at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_45]
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.api.Runner.execute(Runner.java:90) [sonar-runner-api-2.3.jar:na]
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:173) [sonar-maven-plugin-4.0.jar:na]
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:104) [sonar-maven-plugin-2.2.jar:na]
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:67) [sonar-maven-plugin-2.2.jar:na]
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:109) [sonar-maven-plugin-2.2.jar:na]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) [maven-embedder-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) [maven-embedder-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.5.jar:3.0.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]