HHH-11288 - Execution project artifacts are always empty, so dependencies are never included

Get artifacts from project, not executionProject
This commit is contained in:
Craig Andrews 2016-11-29 23:17:58 -05:00 committed by Vlad Mihalcea
parent f7bb312f90
commit 67f7be9a80
1 changed files with 1 additions and 6 deletions

View File

@ -170,13 +170,8 @@ public class MavenEnhancePlugin extends AbstractMojo {
}
// HHH-10145 Add dependencies to classpath as well - all but the ones used for testing purposes
Set<Artifact> artifacts = null;
MavenProject project = ( (MavenProject) getPluginContext().get( "project" ) );
if ( project != null ) {
// Prefer execution project when available (it includes transient dependencies)
MavenProject executionProject = project.getExecutionProject();
artifacts = ( executionProject != null ? executionProject.getArtifacts() : project.getArtifacts() );
}
Set<Artifact> artifacts = project.getArtifacts();
if ( artifacts != null) {
for ( Artifact a : artifacts ) {
if ( !Artifact.SCOPE_TEST.equals( a.getScope() ) ) {