public void loadSettingsProfiles( Settings settings ) { if ( settings == null ) { return; } List settingsProfiles = settings.getProfiles(); List settingsActiveProfileIds = settings.getActiveProfiles(); explicitlyActivate( settingsActiveProfileIds ); if ( settingsProfiles != null && !settingsProfiles.isEmpty() ) { for ( Iterator it = settings.getProfiles().iterator(); it.hasNext(); ) { org.apache.maven.settings.Profile rawProfile = (org.apache.maven.settings.Profile) it.next(); Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile ); addProfile( profile ); } } } }
public void explicitlyDeactivate( List<String> profileIds ) { for ( String profileId1 : profileIds ) { explicitlyDeactivate( profileId1 ); } }
public MavenProject buildStandaloneSuperProject( ArtifactRepository localRepository ) throws ProjectBuildingException { //TODO mkleint - use the (Container, Properties) constructor to make system properties embeddable ProfileManager profileManager = new DefaultProfileManager( container ); return buildStandaloneSuperProject( new DefaultProjectBuilderConfiguration().setLocalRepository( localRepository ) .setGlobalProfileManager( profileManager ) ); }
public void explicitlyActivate( List<String> profileIds ) { for ( String profileId1 : profileIds ) { explicitlyActivate( profileId1 ); } }
public void addProfiles( List<Profile> profiles ) { for ( Profile profile1 : profiles ) { addProfile( profile1 ); } }
public void addProfile( Profile profile ) { String profileId = profile.getId(); Profile existing = profilesById.get( profileId ); if ( existing != null ) { logger.warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ") with new instance from source: " + profile.getSource() ); } profilesById.put( profile.getId(), profile ); Activation activation = profile.getActivation(); if ( activation != null && activation.isActiveByDefault() ) { activateAsDefault( profileId ); } }
if ( externalProfileManager != null ) superProjectProfileManager = new DefaultProfileManager( container, externalProfileManager.getRequestProperties() ); superProjectProfileManager = new DefaultProfileManager( container );
public void explicitlyActivate( List profileIds ) { for ( Iterator it = profileIds.iterator(); it.hasNext(); ) { String profileId = (String) it.next(); explicitlyActivate( profileId ); } }
public void addProfiles( List profiles ) { for ( Iterator it = profiles.iterator(); it.hasNext(); ) { Profile profile = (Profile) it.next(); addProfile( profile ); } }
public void addProfile( Profile profile ) { String profileId = profile.getId(); Profile existing = (Profile) profilesById.get( profileId ); if ( existing != null ) { container.getLogger().warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ") with new instance from source: " + profile.getSource() ); } profilesById.put( profile.getId(), profile ); Activation activation = profile.getActivation(); if ( activation != null && activation.isActiveByDefault() ) { activateAsDefault( profileId ); } }
if ( externalProfileManager != null ) profileManager = new DefaultProfileManager( container, externalProfileManager.getRequestProperties() ); profileManager = new DefaultProfileManager( container );
public void explicitlyDeactivate( List profileIds ) { for ( Iterator it = profileIds.iterator(); it.hasNext(); ) { String profileId = (String) it.next(); explicitlyDeactivate( profileId ); } }
profileManager = new DefaultProfileManager( container );
private ProfileManager getProfileManager( Settings settings ) { if ( profileManager == null ) { profileManager = new DefaultProfileManager( container, settings ); } return profileManager; }
private ProfileManager getProfileManager( Settings settings ) { Properties props = new Properties(); return new DefaultProfileManager( container, settings, props ); }
private ProfileManager getProfileManager() { if ( profileManager == null ) { profileManager = new DefaultProfileManager( container, getSettings() ); } return profileManager; }
private ProfileManager getProfileManager() { if ( profileManager == null ) { profileManager = new DefaultProfileManager( container, getSettings() ); } return profileManager; }
/** * Default constructor. * * @param log the logger provided by the Maven client that is the client to * this context. * @param container the plexus container with further information to be set. * @param localRepositoryDirName the path to the local repository. * @throws ComponentLookupException if a required component cannot be found. */ public DefaultMavenContext(final Log log, final PlexusContainer container, final String localRepositoryDirName) throws ComponentLookupException { this.log = log; this.container = container; projectBuilder = (MavenProjectBuilder) container.lookup(MavenProjectBuilder.ROLE); repositoryLayout = (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, "default"); initLocalRepository(localRepositoryDirName); profileManager = new DefaultProfileManager(container, (Properties) null); }
protected ProfileManager getProfileManager() { if ( profileManager == null ) { profileManager = new DefaultProfileManager( getContainer(), getSettings(), System.getProperties() ); } return profileManager; }
/** * Execute the dependency calculator. * @return List of dependency files. * @throws Exception If anything goes wrong. */ public Set<File> execute() throws Exception { ProfileManager profileManager = new DefaultProfileManager(container); fixupProjectArtifact(); // Calculate the new deps Artifact art = mavenProject.getArtifact(); Artifact art2 = artifactFactory.createArtifactWithClassifier(art .getGroupId() + ".cargodeps", art.getArtifactId(), art.getVersion(), "pom", null); resolver.resolve(art2, remoteRepositories, localRepository); MavenProject mavenProject = mavenProjectBuilder.buildWithDependencies( art2.getFile(), localRepository, profileManager); Set<File> filesToAdd = new HashSet<File>(); for (Object artifact : mavenProject.getArtifacts()) { Artifact artdep = (Artifact) artifact; if (artdep.getType().equals("jar")) { resolver.resolve(artdep, remoteRepositories, localRepository); filesToAdd.add(artdep.getFile()); } } return filesToAdd; }