我最近在Sonarqube(5.1.1)中激活了以下规则:
现在我得到一个ArrayOutOfBoundsException:
[DEBUG] [16:25:04.971] Decorators: ManualMeasureDecorator -> QProfileEventsDecorator -> org.sonar.batch.design.ProjectDsmDecorator@f11bc3 -> org.sonar.batch.design.SubProjectDsmDecorator@155b434 -> org.sonar.batch.design.DirectoryDsmDecorator@1a9fa00 -> FileTangleIndexDecorator -> SumDuplicationsDecorator -> UnitTestDecorator -> org.sonar.plugins.core.security.ApplyProjectRolesDecorator@81db67 -> org.sonar.plugins.core.sensors.DirectoriesDecorator@567bc5 -> org.sonar.plugins.core.sensors.FilesDecorator@1d7c3b5 -> org.sonar.plugins.core.timemachine.TimeMachineConfigurationPersister@6da7af -> org.sonar.plugins.core.timemachine.NewCoverageFileAnalyzer@71df98 -> org.sonar.plugins.core.timemachine.NewItCoverageFileAnalyzer@e7d9d -> org.sonar.plugins.core.timemachine.NewOverallCoverageFileAnalyzer@15908eb -> org.sonar.plugins.core.timemachine.NewCoverageAggregator@588740 -> f(lines) -> f(generated_lines) -> f(ncloc) -> f(generated_ncloc) -> f(classes) -> f(packages) -> f(functions) -> f(accessors) -> f(statements) -> f(public_api) -> f(comment_lines) -> f(public_undocumented_api) -> f(commented_out_code_lines) -> f(complexity) -> f(complexity_in_classes) -> f(complexity_in_functions) -> f(class_complexity_distribution) -> f(function_complexity_distribution) -> f(file_complexity_distribution) -> f(lines_to_cover) -> f(uncovered_lines) -> f(conditions_to_cover) -> f(uncovered_conditions) -> f(it_lines_to_cover) -> f(it_uncovered_lines) -> f(it_conditions_to_cover) -> f(it_uncovered_conditions) -> f(overall_lines_to_cover) -> f(overall_uncovered_lines) -> f(overall_conditions_to_cover) -> f(overall_uncovered_conditions) -> f(rfc) -> f(rfc_distribution) -> f(lcom4_distribution) -> f(package_cycles) -> f(package_tangles) -> f(package_feedback_edges) -> f(package_edges_weight) -> f(new_lines_to_cover) -> f(new_uncovered_lines) -> f(new_conditions_to_cover) -> f(new_uncovered_conditions) -> f(new_it_lines_to_cover) -> f(new_it_uncovered_lines) -> f(new_it_conditions_to_cover) -> f(new_it_uncovered_conditions) -> f(new_overall_lines_to_cover) -> f(new_overall_uncovered_lines) -> f(new_overall_conditions_to_cover) -> f(new_overall_uncovered_conditions) -> org.sonar.batch.language.LanguageDistributionDecorator@16cc1dd -> DirectoryTangleIndexDecorator -> org.sonar.batch.cpd.decorators.DuplicationDensityDecorator@1aaebaf -> CommentDensityDecorator -> f(file_complexity) -> f(class_complexity) -> f(function_complexity) -> org.sonar.plugins.core.sensors.LineCoverageDecorator@deec30 -> org.sonar.plugins.core.sensors.CoverageDecorator@1648255 -> org.sonar.plugins.core.sensors.BranchCoverageDecorator@1a8bbfd -> org.sonar.plugins.core.sensors.ItLineCoverageDecorator@cdf676 -> org.sonar.plugins.core.sensors.ItCoverageDecorator@1efcdcd -> org.sonar.plugins.core.sensors.ItBranchCoverageDecorator@b06757 -> org.sonar.plugins.core.sensors.OverallLineCoverageDecorator@150bda1 -> org.sonar.plugins.core.sensors.OverallCoverageDecorator@1d1b166 -> org.sonar.plugins.core.sensors.OverallBranchCoverageDecorator@1d5aaba -> Common Rules for java -> org.sonar.batch.issue.tracking.IssueTrackingDecorator@94dc01 -> org.sonar.batch.debt.DebtDecorator@12bcb44 -> org.sonar.batch.debt.NewDebtDecorator@2df694 -> CountUnresolvedIssuesDecorator -> CountFalsePositivesDecorator -> org.sonar.batch.debt.SqaleRatingDecorator@1978848 -> org.sonar.plugins.core.timemachine.TendencyDecorator@18aadb2 -> VariationDecorator -> QualityGateVerifier -> org.sonar.batch.qualitygate.GenerateQualityGateEvents@177f07
[DEBUG] [16:25:05.049] Release semaphore on project : org.sonar.api.resources.Project@11a5ab8[id=955,key=xxxxxxxxx:XXXXXXXXXXX,qualifier=TRK], with key batch-xxxxxxxxx:XXXXXXXXXXX
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] XXXXXXXXXXX ....................................... FAILURE [06:55 min]
[INFO] XXXXXXXXX ......................................... SKIPPED
[INFO] XXXXXXXXX ......................................... SKIPPED
[INFO] XXXXXXXX .......................................... SKIPPED
[INFO] XXXXXXXXXXXXX ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:56 min
[INFO] Finished at: 2016-05-12T16:25:05+01:00
[INFO] Final Memory: 52M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXXXXXXXXXX: Fail to decorate 'org.sonar.api.resources.File@18260be[key=src/main/java/xxxxxxxxx/model/BaseEntity.java,path=src/main/java/xxxxxxxxx/BaseEntity.java,filename=BaseEntity.java,language=Java]': 163 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXXXXXXXXXX: Fail to decorate 'org.sonar.api.resources.File@18260be[key=src/main/java/xxxxxxxxx/model/BaseEntity.java,path=src/main/java/xxxxxxxxx/model/BaseEntity.java,filename=BaseEntity.java,language=Java]'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to decorate 'org.sonar.api.resources.File@18260be[key=src/main/java/xxxxxxxxx/model/BaseEntity.java,path=src/main/java/xxxxxxxxx/model/BaseEntity.java,filename=BaseEntity.java,language=Java]'
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:138)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@18260be[key=src/main/java/xxxxxxxxx/model/BaseEntity.java,path=src/main/java/xxxxxxxxx/model/BaseEntity.java,filename=BaseEntity.java,language=Java]'
at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:104)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:87)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:71)
at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:127)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
... 22 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 163
at org.sonar.batch.issue.tracking.FileHashes.getHash(FileHashes.java:89)
at org.sonar.batch.issue.tracking.IssueTracking.setChecksumOnNewIssues(IssueTracking.java:66)
at org.sonar.batch.issue.tracking.IssueTracking.track(IssueTracking.java:51)
at org.sonar.batch.issue.tracking.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:139)
at org.sonar.batch.issue.tracking.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:113)
at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:96)
... 57 more
[ERROR]
[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
Build step 'Maven Goals aufrufen' marked build as failure
Finished: FAILURE
任何人都知道我如何找到导致问题的规则,而无需亲自尝试每个规则?
修改 我确定了导致我的问题的规则(我不知道为什么或者这是否是特定于项目的):