/** * Method addProfile. * * @param profile */ public void addProfile( Profile profile ) { getProfiles().add( profile ); } //-- void addProfile( Profile )
private List<Profile> determineActiveProfiles(Settings settings) { SpringBootCliModelProblemCollector problemCollector = new SpringBootCliModelProblemCollector(); List<org.apache.maven.model.Profile> activeModelProfiles = createProfileSelector() .getActiveProfiles(createModelProfiles(settings.getProfiles()), new SpringBootCliProfileActivationContext( settings.getActiveProfiles()), problemCollector); if (!problemCollector.getProblems().isEmpty()) { throw new IllegalStateException(createFailureMessage(problemCollector)); } List<Profile> activeProfiles = new ArrayList<>(); Map<String, Profile> profiles = settings.getProfilesAsMap(); for (org.apache.maven.model.Profile modelProfile : activeModelProfiles) { activeProfiles.add(profiles.get(modelProfile.getId())); } return activeProfiles; }
/** * Method removeProfile. * * @param profile */ public void removeProfile( Profile profile ) { getProfiles().remove( profile ); } //-- void removeProfile( Profile )
private List<Profile> determineActiveProfiles(Settings settings) { SpringBootCliModelProblemCollector problemCollector = new SpringBootCliModelProblemCollector(); List<org.apache.maven.model.Profile> activeModelProfiles = createProfileSelector() .getActiveProfiles(createModelProfiles(settings.getProfiles()), new SpringBootCliProfileActivationContext( settings.getActiveProfiles()), problemCollector); if (!problemCollector.getProblems().isEmpty()) { throw new IllegalStateException(createFailureMessage(problemCollector)); } List<Profile> activeProfiles = new ArrayList<Profile>(); Map<String, Profile> profiles = settings.getProfilesAsMap(); for (org.apache.maven.model.Profile modelProfile : activeModelProfiles) { activeProfiles.add(profiles.get(modelProfile.getId())); } return activeProfiles; }
/** * @return a Map of profiles field with <code>Profile#getId()</code> as key * @see org.apache.maven.settings.Profile#getId() */ public java.util.Map<String, Profile> getProfilesAsMap() { if ( profileMap == null ) { profileMap = new java.util.LinkedHashMap<String, Profile>(); if ( getProfiles() != null ) { for ( Profile profile : getProfiles() ) { profileMap.put( profile.getId(), profile ); } } } return profileMap; }
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 ); } } } }
shallowMergeById( dominant.getServers(), recessive.getServers(), recessiveSourceLevel ); shallowMergeById( dominant.getProxies(), recessive.getProxies(), recessiveSourceLevel ); shallowMergeById( dominant.getProfiles(), recessive.getProfiles(), recessiveSourceLevel );
if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) ) for ( Iterator iter = settings.getProfiles().iterator(); iter.hasNext(); )
List<Profile> profiles = settings.getProfiles();
/** * Method addProfile. * * @param profile */ public void addProfile( Profile profile ) { getProfiles().add( profile ); } //-- void addProfile( Profile )
/** * Method removeProfile. * * @param profile */ public void removeProfile( Profile profile ) { getProfiles().remove( profile ); } //-- void removeProfile( Profile )
/** * @return a Map of profiles field with <code>Profile#getId()</code> as key * @see org.apache.maven.settings.Profile#getId() */ public java.util.Map<String, Profile> getProfilesAsMap() { if ( profileMap == null ) { profileMap = new java.util.LinkedHashMap<String, Profile>(); if ( getProfiles() != null ) { for ( Profile profile : getProfiles() ) { profileMap.put( profile.getId(), profile ); } } } return profileMap; }
for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
/** * @param settings could be null * @return a new instance of settings or null if settings was null. */ public static Settings copySettings( Settings settings ) { if ( settings == null ) { return null; } Settings clone = new Settings(); clone.setActiveProfiles( settings.getActiveProfiles() ); clone.setInteractiveMode( settings.isInteractiveMode() ); clone.setLocalRepository( settings.getLocalRepository() ); clone.setMirrors( settings.getMirrors() ); clone.setModelEncoding( settings.getModelEncoding() ); clone.setOffline( settings.isOffline() ); clone.setPluginGroups( settings.getPluginGroups() ); clone.setProfiles( settings.getProfiles() ); clone.setProxies( settings.getProxies() ); clone.setServers( settings.getServers() ); clone.setSourceLevel( settings.getSourceLevel() ); clone.setUsePluginRegistry( settings.isUsePluginRegistry() ); return clone; } }
for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) ) for ( Iterator iter = settings.getProfiles().iterator(); iter.hasNext(); )
private List<Profile> getSettingsDefinedProfiles() { return MavenConverter.asProfiles(getSettings().getProfiles()); }
private List<Profile> getSettingsDefinedProfiles() { return MavenConverter.asProfiles(getSettings().getProfiles()); }
private List<Profile> getActiveProfiles() throws MavenException { Settings settings = getSettings(); List<String> activeProfilesIds = settings.getActiveProfiles(); ArrayList<Profile> activeProfiles = new ArrayList<Profile>(); for (org.apache.maven.settings.Profile settingsProfile : settings.getProfiles()) { if ((settingsProfile.getActivation() != null && settingsProfile.getActivation().isActiveByDefault()) || activeProfilesIds.contains(settingsProfile.getId())) { Profile profile = SettingsUtils.convertFromSettingsProfile(settingsProfile); activeProfiles.add(profile); } } return activeProfiles; }
private Collection<RemoteRepository> initExtraRepositories() { Collection<RemoteRepository> extraRepositories = new HashSet<RemoteRepository>(); for ( Profile profile : settings.getProfiles() ) { if ( isProfileActive( profile ) ) { for ( Repository repository : profile.getRepositories() ) { extraRepositories.add( toRemoteRepositoryBuilder( settings, repository ).build() ); } for ( Repository repository : profile.getPluginRepositories() ) { extraRepositories.add( toRemoteRepositoryBuilder( settings, repository ).build() ); } } } return extraRepositories; }