Continuous integration luntbuild&x2B;maven+;findbugs=OutOfMemoryException

Continuous integration luntbuild&x2B;maven+;findbugs=OutOfMemoryException,continuous-integration,findbugs,luntbuild,Continuous Integration,Findbugs,Luntbuild,我一直试图让Luntbuild为我们的项目生成并发布一个项目站点,包括Findbugs报告。所有其他报告(Cobertura、Surefire、JavaDoc、Dashboard)都运行良好,但Findbugs以OutOfMemory异常退出。从报告生成中排除findbugs修复了构建——尽管显然没有findbugs报告 有趣的是,我第一次在本地遇到这个问题,并通过设置MAVEN_OPTS=-Xmx512m来解决它。然而,这在Luntbuild中似乎还不够:将完全相同的选项设置为my build

我一直试图让Luntbuild为我们的项目生成并发布一个项目站点,包括Findbugs报告。所有其他报告(Cobertura、Surefire、JavaDoc、Dashboard)都运行良好,但Findbugs以OutOfMemory异常退出。从报告生成中排除findbugs修复了构建——尽管显然没有findbugs报告

有趣的是,我第一次在本地遇到这个问题,并通过设置MAVEN_OPTS=-Xmx512m来解决它。然而,这在Luntbuild中似乎还不够:将完全相同的选项设置为my builder的环境变量并没有什么区别

我在“net”上发现了一些帖子,指出您还应该将-XX:MaxPermSize=512m添加到MAVEN_OPTS和/或将-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>
生成日志的尾部:

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'
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!

请注意,maven显然只使用70MB。。。但这可能并不意味着什么,因为Findbugs插件有自己的过程。

我对Luntbuild或maven都没有任何经验,但这可能会帮助您:

  • 如果错误消息是“OutOfMemoryError:Java堆空间”,那么
    Xmx
    设置就是适合您的
    -XX:MaxPermSize=512m
    选项处理PermGen空间,这是一个不同的选项
  • 如您所述,如果FindBugs启动自己的进程,那么设置
    MAVEN_OPTS
    似乎并不相关。我建议尝试为FindBugs JVM设置
    Xmx
    。也许其他人会提供如何做的细节
编辑: 似乎涵盖了设置堆大小的主题。默认值为512M,您可以使用
maxHeap
进行更改。唯一的问题是,它似乎只有在版本
2.2
之后才可能实现