How to resolve Unable to parse configuration of mojo org.codehaus.mojo:findbugs-maven-plugin?
1. Introduction
In this post, I will demonstrate how to resolve the following error when you run mvn
commands on a project with the FindBugs plugin:
[ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:3.0.2:findbugs (findbugs) on project project1: Unable to parse configuration of mojo org.codehaus.mojo:findbugs-maven-plugin:3.0.2:findbugs for parameter pluginArtifacts: Cannot assign configuration entry 'pluginArtifacts' with value '${plugin.artifacts}' of type java.util.Collections.UnmodifiableRandomAccessList to property of type java.util.ArrayList -> [Help 1]
2. Environment
- Maven 3.6.0+
- findbugs-maven-plugin 3.0.2
3. The pom.xml
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>3.0.2</version> <configuration> <!-- Enables analysis which takes more memory but finds more bugs. If you run out of memory, changes the value of the effort element to 'Low'. --> <effort>Max</effort> <!-- Build fail if problems are found --> <failOnError>false</failOnError> <!-- Reports all bugs (other values are medium and max) --> <threshold>Low</threshold> <!-- Produces XML report --> <xmlOutput>true</xmlOutput> <!-- Configures the directory in which the XML report is created --> <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory> </configuration> <executions> <!-- Ensures that FindBugs inspects source code when project is compiled. --> <execution> <id>analyze-compile</id> <phase>compile</phase> <goals> <goal>check</goal> </goals> </execution> </executions></plugin>
4. How to resolve this problem?
4.1 Downgrade your Maven version
If you are using version 3.0.2 of the findbugs-maven-plugin
, it is not compatible with Maven 3.6.0+.
Check your Maven version using the following command:
➜ conf mvn --versionApache Maven 3.6.0 ....Maven home: /Users/bswen/tech/maven/apache-maven-3.6.0Java version: 1.8.0_121, vendor: Oracle CorporationJava home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
If you are using a Maven version greater than 3.6.0, you should downgrade to an older version by downloading it from its official site.
The recommended version is 3.3.9.
4.2 Upgrade your findbugs-maven-plugin version
Alternatively, you can upgrade your findbugs-maven-plugin
to version 3.0.4+, which is compatible with Maven 3.6.0+.
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>3.0.4</version> ...</plugin>
5. Summary
When using the findbugs-maven-plugin
, ensure compatibility with your Maven version. Downgrading Maven to 3.3.9 or upgrading the plugin to 3.0.4+ are effective solutions to resolve the “Unable to parse configuration of mojo” error. Always verify your environment and plugin versions to avoid such issues.
Final Words + More Resources
My intention with this article was to help others who might be considering solving such a problem. So I hope that’s been the case here. If you still have any questions, don’t hesitate to ask me by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!