mirror of https://github.com/apache/maven.git
[MNG-4900] "Unresolveable build extension" when using shade plugin and repositories in profile
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1036433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2945612129
commit
8d53cd4cc6
|
@ -85,6 +85,26 @@ public class DefaultMavenProjectBuilder
|
||||||
request.setActiveProfileIds( profileManager.getExplicitlyActivatedIds() );
|
request.setActiveProfileIds( profileManager.getExplicitlyActivatedIds() );
|
||||||
request.setInactiveProfileIds( profileManager.getExplicitlyDeactivatedIds() );
|
request.setInactiveProfileIds( profileManager.getExplicitlyDeactivatedIds() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* MNG-4900: Hack to workaround deficiency of legacy API which makes it impossible for plugins to access the
|
||||||
|
* global profile manager which is required to build a POM like a CLI invocation does. Failure to consider
|
||||||
|
* the activated profiles can cause repo declarations to be lost which in turn will result in artifact
|
||||||
|
* resolution failures, in particular when using the enhanced local repo which guards access to local files
|
||||||
|
* based on the configured remote repos.
|
||||||
|
*/
|
||||||
|
MavenSession session = legacySupport.getSession();
|
||||||
|
if ( session != null )
|
||||||
|
{
|
||||||
|
MavenExecutionRequest req = session.getRequest();
|
||||||
|
if ( req != null )
|
||||||
|
{
|
||||||
|
request.setActiveProfileIds( req.getActiveProfiles() );
|
||||||
|
request.setInactiveProfileIds( req.getInactiveProfiles() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue