跪求高手帮助!使用maven3.0.5,sonar3.6,执行sonar:sonar最后报错,信息如下:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project udmptest: Can not execute Sonar: Sonar is unable to analyze file : 'E:\workspace1\udmptest\src\main\java\mavenstudy\App.java': Unable to save measure for metric [comment_lines_data] on resource [mavenstudy.App]:
[ERROR] ### Error updating database. Cause: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: java.lang.ArrayIndexOutOfBoundsException: 20
[ERROR] ### SQL: INSERT INTO project_measures ( id, value, metric_id, snapshot_id, rule_id, text_value, tendency, measure_date, project_id, alert_status, alert_text, url, description, rule_priority, characteristic_id, variation_value_1, variation_value_2, variation_value_3, variation_value_4, variation_value_5, person_id) VALUES ( project_measures_seq.NEXTVAL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
[ERROR] ### Cause: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: java.lang.ArrayIndexOutOfBoundsException: 20
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project udmptest: Can not execute Sonar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.sonar.squid.api.AnalysisException: Sonar is unable to analyze file : 'E:\workspace1\udmptest\src\main\java\mavenstudy\App.java'
at org.sonar.java.ast.AstScanner.scan(AstScanner.java:132)
at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:113)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:107)
at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:115)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:142)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:169)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:164)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:151)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
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:80)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute
我也遇到这个问题了
http://stackoverflow.com/questions/16615116/jenkins-sonar-new-error-after-server-restart
维护Sonar也有半年多的时间了,感觉Sonar屎烂,根本没人看。版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。