requiresDependencyResolution must bet set in plugin.xml to include maven dependencies in enhancement classpath
Description
Activity
Show:

Former user March 15, 2017 at 12:21 AM
Fixed in 5.1 branch as well.
Vlad Mihalcea December 8, 2016 at 9:05 AM
Applied PR upstream. Thanks.
You might want to backport this since it affects 5.1 and 5.0 as well.

Craig Andrews November 30, 2016 at 4:22 AM
Note that dependencies aren't included as intended in until both this issue and are fixed.

Craig Andrews November 30, 2016 at 3:48 AM
Here's the (very simple) pull request which fixes this issue: https://github.com/hibernate/hibernate-orm/pull/1656
In HHH-10145, a change was made intending to include maven dependencies in enhancement classpath.
However, the plugin descriptor (plugin.xml) was not changed. Maven requires the plugin descriptor to include:
or else it doesn't resolve dependencies before invoking the mojo so mavenProject.getArtifacts() always returns an empty array.
If Maven was used to build hibernate-enhance-maven-plugin, then maven-plugin-annotations would keep plugin.xml in sync wit the annotations... however, that's not the case here, so care must be taken to keep plugin.xml and the @Mojo annotation on the MavenEnhancePlugin in sync.