2012-05-15 76 views
3

我在自己的電腦上安裝了聲吶服務器(Windows XP),並且我在Tomcat上使用MySQL數據庫部署了聲吶。 我成功分析了一箇舊項目。但隨着我當前的項目,我在嘗試執行mvn sonar:sonar當此異常:無法執行聲吶:未能裝飾

編輯:

[INFO] [14:39:37.254] Sensor CoberturaSensor done: 218 ms 
[INFO] [14:39:37.254] Sensor Maven dependencies... 
[INFO] [14:39:41.426] Sensor Maven dependencies done: 4172 ms 
[INFO] [14:39:41.848] Execute decorators... 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1:53.354s 
[INFO] Finished at: Tue May 15 14:39:43 CEST 2012 
[INFO] Final Memory: 21M/138M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d 
efault-cli) on project XXX: Can not execute Sonar: Fail to decorate 'com.myPackage 
.myClass': 793 -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o 
rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: 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.buildProje 
ct(LifecycleModuleBuilder.java:84) 
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje 
ct(LifecycleModuleBuilder.java:59) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu 
ild(LifecycleStarter.java:183) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl 
eStarter.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:537) 
     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(Laun 
cher.java:290) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav 
a:230) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La 
uncher.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(Default 
BuildPluginManager.java:101) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:209) 
     ... 19 more 
Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'com.myPackage.myClass 
' 
     at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(Decorators 
Executor.java:84) 
     at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(Decorators 
Executor.java:70) 
     at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(Decorators 
Executor.java:63) 
     at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(Decorators 
Executor.java:63) 
     at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor. 
java:55) 
     at org.sonar.batch.phases.Phases.execute(Phases.java:94) 
     at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:14 
3) 
     at org.sonar.batch.bootstrap.Module.start(Module.java:83) 
     at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115) 
     at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105) 
     at org.sonar.batch.bootstrap.Module.start(Module.java:83) 
     at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.jav 
a:109) 
     at org.sonar.batch.bootstrap.Module.start(Module.java:83) 
     at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:72) 
     at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:59) 
     at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:143) 
     at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113) 

     ... 23 more 
Caused by: java.lang.ArrayIndexOutOfBoundsException: 793 
     at org.sonar.plugins.core.timemachine.tracking.HashedSequenceComparator. 
equals(HashedSequenceComparator.java:34) 
     at org.sonar.plugins.core.timemachine.ViolationTrackingBlocksRecognizer. 
computeLengthOfMaximalBlock(ViolationTrackingBlocksRecognizer.java:48) 
     at org.sonar.plugins.core.timemachine.ViolationTrackingDecorator.mapViol 
ations(ViolationTrackingDecorator.java:130) 
     at org.sonar.plugins.core.timemachine.ViolationTrackingDecorator.decorat 
e(ViolationTrackingDecorator.java:70) 
     at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(Decorators 
Executor.java:79) 
     ... 39 more 

我不明白問題出在哪裏得來的。請任何人有答案?它可以來自我的POM配置嗎?

PS:在命令行mvn clean installmvn site正常工作......

+1

要查看錯誤的完整堆棧跟蹤,請使用-e開關重新運行Maven。做到這一點,併發布在這裏請。 – oers

+0

@oers,我用-e開關編輯堆棧跟蹤。 – Pith

+0

我在聲吶中刪除了以前版本的我的projet,現在它可以找到。謝謝你在路上刁難我。但我仍然不明白這個問題。 – Pith

回答

5

你面對聲納3.0(=>http://jira.codehaus.org/browse/SONAR-3442)的錯誤。我們發佈瞭解決此問題的Sonar 3.0.1(請參閱http://www.sonarsource.org/downloads/)。

+0

你是對的,這是同樣的錯誤。謝謝你的解釋。 – Pith

+0

您是否也有過使用聲納和svn「重放過去」的想法? – Pith

+1

您可以使用屬性「sonar.projectDate」(請參閱​​http://docs.codehaus.org/display/SONAR/Advanced+parameters)。 –