findbugs-maven-plugin throws OutOfMemoryError, how to fix this
java.lang.OutOfMemoryError: Java heap space
at org.apache.bcel.classfile.Constant.readConstant(Constant.java:14
2)
at org.apache.bcel.classfile.ConstantPool.<init>(ConstantPool.java:
67)
at org.apache.bcel.classfile.ClassParser.readConstantPool(ClassPars
er.java:225)
at org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:136
)
at edu.umd.cs.findbugs.classfile.engine.bcel.JavaClassAnalysisEngin
e.analyze(JavaClassAnalysisEngine.java:55)
at edu.umd.cs.findbugs.classfile.engine.bcel.JavaClassAnalysisEngin
e.analyze(JavaClassAnalysisEngine.java:43)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getClassAnalysi
s(AnalysisCache.java:213)
at edu.umd.cs.findbugs.classfile.engine.bcel.ClassContextClassAnaly
sisEngine.analyze(ClassContextClassAnalysisEngine.java:46)
at edu.umd.cs.findbugs.classfile.engine.bcel.ClassContextClassAnaly
sisEngine.analyze(ClassContextClassAnalysisEngine.java:38)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getClassAnalysi
s(AnalysisCache.java:213)
at edu.umd.cs.findbugs.ba.AnalysisContext.isTooBig(AnalysisContext.
java:385)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:
949)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:222)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor
Impl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod
AccessorImpl.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)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(Invok
erHelper.java:778)
at org.c开发者_如何学JAVAodehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHe
lper.java:758)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(
ScriptBytecodeAdapter.java:170)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(
ScriptBytecodeAdapter.java:198)
at org.codehaus.mojo.findbugs.FindBugsMojo.executeReport(FindBugsMo
jo.groovy:792)
at org.apache.maven.reporting.AbstractMavenReport.generate(Abstract
MavenReport.java:101)
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractM
avenReport.java:66)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(Default
PluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStand
aloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:539)
On a Windows machine, the following command will increase the maximum amount of memory made available to Maven (heap and permGen respectively):
set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
You can also pass a heap size to FindBugs with -maxHeap
精彩评论