if ( externalProfileManager != null ) profileManager = new DefaultProfileManager( container, externalProfileManager.getRequestProperties() ); profileManager.explicitlyActivate( externalProfileManager.getExplicitlyActivatedIds() ); profileManager.explicitlyDeactivate( externalProfileManager.getExplicitlyDeactivatedIds() ); profileManager.addProfiles( model.getProfiles() );
profileManager.explicitlyActivate( root.getActiveProfiles() ); profileManager.addProfile( converted );
externalProfileManager.getRequestProperties() ); superProjectProfileManager.addProfiles( superModel.getProfiles() ); activeExternalProfiles = externalProfileManager.getActiveProfiles();
/** * 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); } } }
if ( profileManager != null ) request.setActiveProfileIds( profileManager.getExplicitlyActivatedIds() ); request.setInactiveProfileIds( profileManager.getExplicitlyDeactivatedIds() );
profileManager.explicitlyActivate(phaseCall.getProfiles());
profileManager.addProfiles( superModel.getProfiles() );
profileManager.explicitlyDeactivate( profileAction.substring( 1 ) ); profileManager.explicitlyActivate( profileAction.substring( 1 ) ); profileManager.explicitlyActivate( profileAction );
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; }
/** * The repositories defined in the ant "pom" task need to be added manually to the profile manager. Otherwise they * won't be available when resolving the parent pom. MANTTASKS-87 */ private void addAntRepositoriesToProfileManager() { List<RemoteRepository> remoteRepositories = this.getRemoteRepositories(); if ( remoteRepositories == null || remoteRepositories.isEmpty() ) { return; } org.apache.maven.model.Profile repositoriesProfile = new org.apache.maven.model.Profile(); repositoriesProfile.setId( "maven-ant-tasks-repo-profile" ); for ( RemoteRepository antRepo : remoteRepositories ) { Repository mavenRepo = new Repository(); mavenRepo.setId( antRepo.getId() ); mavenRepo.setUrl( antRepo.getUrl() ); repositoriesProfile.addRepository( mavenRepo ); } getProfileManager().addProfile( repositoriesProfile ); getProfileManager().explicitlyActivate( repositoriesProfile.getId() ); }