mirror of https://github.com/apache/maven.git
[MNG-7568] Consider inactive profiles for validation
This commit is contained in:
parent
3212efee78
commit
8a5dada82c
|
@ -291,11 +291,15 @@ public class DefaultMaven
|
|||
|
||||
validatePrerequisitesForNonMavenPluginProjects( session.getProjects() );
|
||||
|
||||
validateActivatedProfiles( session.getProjects(), request.getActiveProfiles() );
|
||||
validateActivatedProfiles( session.getProjects(),
|
||||
request.getActiveProfiles(),
|
||||
request.getInactiveProfiles() );
|
||||
|
||||
lifecycleStarter.execute( session );
|
||||
|
||||
validateActivatedProfiles( session.getProjects(), request.getActiveProfiles() );
|
||||
validateActivatedProfiles( session.getProjects(),
|
||||
request.getActiveProfiles(),
|
||||
request.getInactiveProfiles() );
|
||||
|
||||
if ( session.getResult().hasExceptions() )
|
||||
{
|
||||
|
@ -468,7 +472,9 @@ public class DefaultMaven
|
|||
}
|
||||
}
|
||||
|
||||
private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds )
|
||||
private void validateActivatedProfiles( List<MavenProject> projects,
|
||||
List<String> activeProfileIds,
|
||||
List<String> inactiveProfileIds )
|
||||
{
|
||||
Collection<String> notActivatedProfileIds = new LinkedHashSet<>( activeProfileIds );
|
||||
|
||||
|
@ -480,6 +486,8 @@ public class DefaultMaven
|
|||
}
|
||||
}
|
||||
|
||||
notActivatedProfileIds.removeAll( inactiveProfileIds );
|
||||
|
||||
for ( String notActivatedProfileId : notActivatedProfileIds )
|
||||
{
|
||||
logger.warn( "The requested profile \"" + notActivatedProfileId
|
||||
|
|
Loading…
Reference in New Issue