-
Notifications
You must be signed in to change notification settings - Fork 19
Support annotationProcessorPaths option in maven-compiler-plugin 3.5 #47
Comments
It shouldn't be terribly hard to implement : collect the annotationProcessorPaths, trigger artifact resolution and add to .factorypath (before or after the other dependencies?) However I don't think I'll have time to take a serious look at it before a few days. If you feel like providing a PR, please be my guest :-) |
In any case, could you link to a sample project using that feature, once m-c-p 3.5 is released? |
I'll prepare a sample project by tomorrow when I got the plugin release process rounded up... :) |
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Here's a simple sample project: https://github.com/agudian/m-compiler-p-examples I'll also try to come up with another sample that contains transitive dependencies in the annotation processor in the coming days. Thanks again for taking a look! |
I'll test it on Friday. I suggest you make the annotation processor project a separate project, since eclipse APT doesn't support APs from open workspace projects. |
Having to Anyway, I couldn't wait and too a look at your branch already 👍. It wasn't quite working for me, as the version of Xpp3Dom in what's brought with m2e 1.6.2 doesn't have a default-constructor - resulting in an Exception when trying to read the config to an Xpp3Dom instance. This worked for me, though: final Dependency[] configuredDependencies = maven.getMojoParameterValue(mavenProject, mojoExecution,
"annotationProcessorPaths", Dependency[].class, monitor);
PluginDependencyResolver dependencyResolver = new PluginDependencyResolver() {
protected Collection<Dependency> getDependencies(Plugin plugin) {
return configuredDependencies.length == 0
? super.getDependencies(plugin)
: Arrays.asList(configuredDependencies);
}
}; There's one more thing. I noticed that the project dependencies are added to the processor path as well. At least in this scenario, that shouln't be done. I guess an additional flag in |
Yeah I coded that to get a feeling of how it'd look like but didn't test it. I noticed the dependencies shouldn't be added, after re-reading the doc, I need to change that. |
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Awesome, thanks alot! 👍 |
Hi there,
maven-compiler-plugin version 3.5 is being released tomorrow or so, and it would be awesome if m2e-apt would support the new option
annotationProcessorPaths
, which allows to specify the annotation processor path explicitly (see http://maven.apache.org/components/plugins-archives/maven-compiler-plugin-LATEST/compile-mojo.html#annotationProcessorPaths):The resolved dependencies of the artifacts listed in that option would need to be applied in .factorypath.
Would be great if someone could pick this up and implement it.
Thanks!
The text was updated successfully, but these errors were encountered: