Я обнаружил, что библиотека xalan:xalan:jar:2.6.0
(которая была транзитивной зависимостью от библиотеки org.apache.xmlgraphics:batik-bridge:jar:1.7
в моем проекте) содержит класс org.apache.bcel.generic.ObjectType
(возможно, в неправильной версии). Этот класс, возможно, тот, который вызывает следующую ошибку:
[INFO] File Encoding is UTF-8
BCEL class compatability error.
The version of class org.apache.bcel.generic.ObjectType found was not compatible with
FindBugs. Please remove any BCEL libraries that may be interfering. This may happen
if you have an old version of BCEL or a library that includes an old version of BCEL
in an "endorsed" directory.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java returned: 1
[INFO] ------------------------------------------------------------------------
[INFO] Trace
: Java returned: 1
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
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.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:784)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
at org.codehaus.mojo.findbugs.FindBugsGui.execute(FindBugsGui.groovy:163)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Поскольку артефакт не нужен для компиляции (в нашем случае), мы просто изменили его область действия на runtime
в файле Maven pom.xml
, и эта ошибка исчезла, и mvn clean findbugs:findbugs findbugs:gui
снова работает (по крайней мере, для меня) :
...
<dependencies>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-bridge</artifactId>
<version>1.7</version>
<scope>runtime</scope>
</dependency>
</dependencies>
...
Надеюсь, это спасет чью-то задницу ...