Classpath of the maven plugin is not properly set
Testing the Maven plugin with the unit tests works fine. But...testing it in my real-live project revealed that the removal of the explicit classpath setting and usage of the @requiresDependencyResolution annotation is not good enough.
Error loading class ... is the consequence.
When you read the quote from The Maven Guide
Please note that the plugin classloader does neither contain the dependencies of the current project nor its build output. Instead, plugins can query the project's compile, runtime and test class path from the MavenProject in combination with the mojo annotation requiresDependencyResolution from the Mojo API Specification. For instance, flagging a mojo with @requiresDependencyResolution runtime enables it to query the runtime class path of the current project from which it could create further classloaders.
you see that the requiresDependencyResolution does not add the dependencies to the classpath. This is what you need to do yourself.
I will create a branch to fix this.
PR has been created.
Released as v4.11.1.