2015-05-25 123 views
2

我最近升級到最新的SonarQube 5.1,但現在,我的Maven構建已經開始失敗,我無法確定哪個文件導致錯誤。 maven項目是一個多模塊項目。SonarQube 5.1分析失敗,StackOverflowError

用「MVN聲納:聲納」執行
  • SonarQube版本5.1
  • 行家目標(2.6版的使用量和正確地分析部分項目)

Maven構建與以下錯誤結束:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project flex-parentpom: null: MojoExecutionException: StackOverflowError -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project flex-parentpom: null 
    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:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) 
    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 
    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:132) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) 
    ... 19 more 
Caused by: java.lang.StackOverflowError 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBinaryExpression(BaseTreeVisitor.java:208) 
    at org.sonar.java.model.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:85) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) 
    at org.sonar.java.resolve.SemanticModel$1.scan(SemanticModel.java:92) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBinaryExpression(BaseTreeVisitor.java:208) 
    at org.sonar.java.model.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:85) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) 
    at org.sonar.java.resolve.SemanticModel$1.scan(SemanticModel.java:92) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBinaryExpression(BaseTreeVisitor.java:208) 
    at org.sonar.java.model.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:85) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) 
    at org.sonar.java.resolve.SemanticModel$1.scan(SemanticModel.java:92) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBinaryExpression(BaseTreeVisitor.java:208) 
    at org.sonar.java.model.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:85) 
    at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) 
    at org.sonar.java.resolve.SemanticModel$1.scan(SemanticModel.java:92) 

調試錯誤原因的任何想法?我試圖用-debug標誌。

+0

在項目flex-parentpom:null上看起來很奇怪嗎? – khmarbaise

+0

任何想法null可能代表什麼?版本,名稱?聲吶4.X – smox

回答

1

問題已解決。

我最終設置了一個本地實例並使用調試器運行maven插件,這讓我可以在異常處設置斷點。我發現我們有一個測試用例(文件),它有一個由數百個字符串定義的字段。這個文件很長時間沒有被編輯過,所以我猜整個堆棧大小從4.x變成了5.x.測試是醜陋的,因此我在這種情況下的解決方案是重構它。我想另一個解決方案是增加java堆棧大小,但我沒有嘗試過。

+0

確切地說:堆棧並沒有改變:5.x版本中,您使用最新版本的java插件進行語義分析,並且您很可能將這個討厭的bug包含在內:https:/ /jira.codehaus.org/browse/SONARJAVA-793 – benzonico