I have a custom plugin that loads classes, e.g.
Class<?> clazz = Class.forName(NAME_OF_CLASS_FROM_HOST_DEPENDENCIES);
NAME_OF_CLASS_FROM_HOST_DEPENDENCIES - is the class that exists in the dependencies of project, where this plugin is used.
in hosting project pom, I call plugin like this:
<plugin>
<groupId>com.plugins</groupId>
<artifactId>the_plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>do</id>
<phase>process-classes</phase>
<goals>
<goal>do</goal>
</goals>
</execution>
</executions>
</plugin>
Getting ClassNotFoundException
it's important , those dependencies defined in pom as
<scope>provided</scope>