2009-11-26 30 views
0

我一直試圖讓Luntbuild爲我們的項目生成和發佈項目網站,其中包括FindBugs報告。所有其他報告(Cobertura,Surefire,JavaDoc,儀表板)都可以正常工作,但Findbugs會用OutOfMemoryException解決問題。排除來自報告生成的findbugs修復了構建 - 雖然顯然沒有FindBugs報告。luntbuild + maven + findbugs = OutOfMemoryException

有趣的是,我第一次在本地遇到這個問題,並通過設置MAVEN_OPTS = -Xmx512m來解決它。但是,在Luntbuild中,這似乎不夠用:設置與我的構建器的環境變量完全相同的選項沒有什麼區別。

我在'net上發現了一些帖子,指出你還應該爲MAVEN_OPTS添加-XX:MaxPermSize = 512m和/或將-Dmaven.findbugs.jvmargs = -Xmx512m添加到mvn.bat。這些(或他們的組合)似乎沒有幫助,儘管如此任何提示將不勝感激!

乾杯, 約翰內斯

相關信息: Luntbuild的是1.5.6,Maven是2.1.0,FindBugs的,Maven的插件是2.0.1。

這是相關的pom.xml的FindBugs的部分:

<plugin> 
<groupId>org.codehaus.mojo</groupId> 
<artifactId>findbugs-maven-plugin</artifactId> 
<version>2.0.1</version> 
</plugin> 

這是我生成日誌的頭:

Analyzed: C:\luntbuild\somewhere-work\somewhere\...\SomeClass.class 

... 

Analyzed: C:\luntbuild\somewhere-work\somewhere\...\target\classes  
Aux: C:\luntbuild\somewhere-work\somewhere\...\target\classes 
Aux: c:\maven\local-repo\...\somejar-1.1.1.1-SNAPSHOT.jar 
Aux: c:\maven\local-repo\commons-lang\commons-lang\2.3\commons-lang-2.3.jar 

.... 

Aux: c:\maven\local-repo\org\openoffice\ridl\3.1.0\ridl-3.1.0.jar 
Aux: c:\maven\local-repo\org\openoffice\unoil\3.1.0\unoil-3.1.0.jar 
[INFO] ------------------------------------------------------------------------ 
[ERROR] FATAL ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Java heap space 
[INFO] ------------------------------------------------------------------------ 
[DEBUG] Trace 
java.lang.OutOfMemoryError: Java heap space 
at java.util.HashMap.(HashMap.java:209) 
at edu.umd.cs.findbugs.ba.type.TypeAnalysis$CachedExceptionSet.(TypeAnalysis.java:114) 
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.getCachedExceptionSet(TypeAnalysis.java:688) 
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.computeThrownExceptionTypes(TypeAnalysis.java:439) 
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:411) 
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:89) 
at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:356) 
at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:82) 
at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:44) 
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331) 
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281) 
at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:173) 
at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:64) 
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331) 
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281) 
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:937) 
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysisNoDataflowAnalysisException(ClassContext.java:921) 
at edu.umd.cs.findbugs.ba.ClassContext.getCFG(ClassContext.java:326) 
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.analyzeMethod(BuildUnconditionalParamDerefDatabase.java:103) 
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.considerMethod(BuildUnconditionalParamDerefDatabase.java:93) 
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.visitClassContext(BuildUnconditionalParamDerefDatabase.java:79) 
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:68) 
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:971) 
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:222) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756) 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 17 minutes 16 seconds 
[INFO] Finished at: Tue Nov 24 11:31:23 CET 2009 
[INFO] Final Memory: 70M/127M 
[INFO] ------------------------------------------------------------------------ 
Maven2 builder failed: build success condition not met! 

User "luntbuild" started the build 
Perform checkout operation for VCS setting: 
Vcs name: Subversion 
Repository url base: http://some.repository.com/repo/ 
Repository layout: multiple 
Directory for trunk: trunk 
Directory for branches: branches 
Directory for tags: tags 
Username: xxxx 
Password:xxxx 
Web interface: ViewVC 
URL to web interface: http://some.repository.com/repo/ 
Quiet period: 
modules: 
Source path: somepath, Branch: , Label: , Destination path: somewhere 
Source path: somepath, Branch: somewhere1.0.x, Label: , Destination path: somewhere-1.0.x 
Source path: somepath, Branch: somewhere1.1.x, Label: , Destination path: somewhere-1.1.x 

Update url: http://some.repository.com/repo//trunk 
Duration of the checkout operation: 0 minutes 
Perform build with builder setting: 
Builder name: default 
Builder type: Maven2 builder 
Command to run Maven2: "C:\maven\apache-maven-2.1.0\bin\mvn.bat" -e -f somewhere\pom.xml -P site -Dmaven.test.skip=false -DbuildDate="Tue Nov 24 11:13:24 CET 2009" -DbuildVersion="site-core138" 
-Dsvn.username=xxxx -Dsvn.password=xxxx -DstagingSiteURL=file:///C:/luntbuild/core-reports 
-Dmaven.findbugs.jvmargs=-Xmx512m 
Directory to run Maven2 in: 
Goals to build: site:stage site:stage-deploy 
Build properties: buildVersion="site-core138" 
artifactsDir="C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts" 
buildDate="Tue Nov 24 11:13:24 CET 2009" 
junitHtmlReportDir="" 
Environment variables: MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=512m" 
Build success condition: result==0 and builderLogContainsLine("INFO","BUILD SUCCESSFUL") 

Execute command: Executing 'C:\maven\apache-maven-2.1.0\bin\mvn.bat' with arguments: 
'-e' 
'-f' 
'somewhere\pom.xml' 
'-P' 
'site' 
'-Dmaven.test.skip=false' 
'-DbuildDate=Tue Nov 24 11:13:24 CET 2009' 
'-DbuildVersion=site-core138' 
'-Dsvn.username=xxxxxx' 
'-Dsvn.password=xxxxxx' 
'-DstagingSiteURL=file:///C:/luntbuild/reports' 
'-Dmaven.findbugs.jvmargs=-Xmx512m' 
'-DbuildVersion=site-core138' 
'-DartifactsDir=C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts' 
'-DbuildDate=Tue Nov 24 11:13:24 CET 2009' 
'-X' 
'site:stage' 
'site:stage-deploy' 

我生成日誌尾

請注意,顯然maven只使用70MB ...但這可能並不意味着什麼,因爲Findbugs插件會自行分發它秒。

回答

0

我沒有與任何的任何經驗:Luntbuild的或Maven,但是這可能會幫助你:如果錯誤消息「的OutOfMemoryError:Java堆空間」

  • ,則Xmx設置是一個爲你。 -XX:MaxPermSize=512m選項涉及PermGen空間,這是一個不同的空間。
  • 如您所提到的,如果FindBugs啓動它自己的進程,那麼設置MAVEN_OPTS似乎不相關。我會建議嘗試找到如何爲FindBugs JVM設置Xmx。其他人可能會提供有關如何操作的詳細信息。

編輯: Documentation for Maven FindBugs Plugin似乎涵蓋設置堆大小的主題。默認值是512M,您可以使用maxHeap更改它。唯一的問題是,它似乎只能從版本2.2