I would like to use Google Reflections to crawl classes from a compiled project from my Maven plugin. But plugins do not see compiled project classes by default. From the Maven 3 Documentation I read:
Plugins that need to load classes from the compilation / execution / test path for the project must create their own URLClassLoader in combination with the mojo @requiresDependencyResolution annotation.
This is a bit vague, to say the least. Basically I need a link to a class loader that loads compiled project classes. How to get it?
EDIT:
Well, the @Mojo annotation has a requiresDependencyResolution parameter, so it's easy, but you still need to properly build the class loader.
java maven classloader google-reflections
vertti
source share