Groovy method call error


What's inside this article ⌄
  • Groovy method call error
  • Groovy methodmissingerror fix
  • Groovy cannot call method
  • Groovy method invocation error

You may encounter an error when compiling your project that looks like this:

Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6:compile (default) on project <project>: Error occurred while calling a method on a Groovy class from classpath.

It is not at all clear what class are meant. If you work with IntelliJ IDEA – this is the reason. Sometimes it parses maven build/compile logs incorrectly, so the second part of the exception was lost.

Compile manually through the terminal with the command:

mvn clean package

And you will see the full text of the error. For example:

Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6:compile (default) on project <project>: Error occurred while calling a method on a Groovy class from classpath.
InvocationTargetException: <…some_path…>/SomeClass.java or groovy.

So, in this case, it’s most likely a dependency conflict.