profileManager.explicitlyDeactivate( externalProfileManager.getExplicitlyDeactivatedIds() );
/** * Actives profiles, as if the "-P" command line option is used. * * <p> * In Maven CLI this is done before the {@link ProfileManager#loadSettingsProfiles(Settings)} * is called. I don't know if that's a hard requirement or just a coincidence, * but since I can't be sure, I'm following the exact call order that Maven CLI does, * and not allowing this method to be called afterward. */ private void activeProfiles() { if(profiles==null) return; // noop for (String token : profiles.split(",")) { token = token.trim(); if (token.length()==0) continue; if (token.startsWith("-")) { profileManager.explicitlyDeactivate(token.substring(1)); } else if (token.startsWith("+")) { profileManager.explicitlyActivate(token.substring(1)); } else { // TODO: deprecate this eventually! profileManager.explicitlyActivate(token); } } }
profileManager.explicitlyDeactivate( profileAction.substring( 1 ) );
private ProfileManager getActivatedProfiles() { ProfileManager profileManager = getProfileManager(); for ( Profile profile : getProfiles() ) { if ( profile.getId() == null ) { throw new BuildException( "Attribute \"id\" is required for profile in pom type." ); } if ( profile.getActive() == null || Boolean.valueOf( profile.getActive() ).booleanValue() ) { profileManager.explicitlyActivate( profile.getId() ); } else { profileManager.explicitlyDeactivate( profile.getId() ); } } return profileManager; }