本文整理了Java中org.apache.maven.settings.Settings.getProfiles()
方法的一些代码示例,展示了Settings.getProfiles()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.getProfiles()
方法的具体详情如下:
包路径:org.apache.maven.settings.Settings
类名称:Settings
方法名:getProfiles
[英]Method getProfiles.
[中]方法getProfiles。
代码示例来源:origin: apache/maven
/**
* Method addProfile.
*
* @param profile
*/
public void addProfile( Profile profile )
{
getProfiles().add( profile );
} //-- void addProfile( Profile )
代码示例来源:origin: org.springframework.boot/spring-boot-cli
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;
}
代码示例来源:origin: apache/maven
/**
* Method removeProfile.
*
* @param profile
*/
public void removeProfile( Profile profile )
{
getProfiles().remove( profile );
} //-- void removeProfile( Profile )
代码示例来源:origin: spring-cloud/spring-cloud-function
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;
}
代码示例来源:origin: apache/maven
/**
* @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;
}
代码示例来源:origin: org.apache.maven/maven-project
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 );
}
}
}
}
代码示例来源:origin: apache/maven
shallowMergeById( dominant.getServers(), recessive.getServers(), recessiveSourceLevel );
shallowMergeById( dominant.getProxies(), recessive.getProxies(), recessiveSourceLevel );
shallowMergeById( dominant.getProfiles(), recessive.getProfiles(), recessiveSourceLevel );
代码示例来源:origin: apache/maven
if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) )
for ( Iterator iter = settings.getProfiles().iterator(); iter.hasNext(); )
代码示例来源:origin: apache/maven
List<Profile> profiles = settings.getProfiles();
代码示例来源:origin: org.apache.maven/maven-settings
/**
* Method addProfile.
*
* @param profile
*/
public void addProfile( Profile profile )
{
getProfiles().add( profile );
} //-- void addProfile( Profile )
代码示例来源:origin: org.apache.maven/maven-settings
/**
* Method removeProfile.
*
* @param profile
*/
public void removeProfile( Profile profile )
{
getProfiles().remove( profile );
} //-- void removeProfile( Profile )
代码示例来源:origin: org.apache.maven/maven-settings
/**
* @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;
}
代码示例来源:origin: apache/maven
for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
代码示例来源:origin: apache/maven
/**
* @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;
}
}
代码示例来源:origin: apache/maven
for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
代码示例来源:origin: org.apache.maven/maven-settings
if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) )
for ( Iterator iter = settings.getProfiles().iterator(); iter.hasNext(); )
代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven
private List<Profile> getSettingsDefinedProfiles() {
return MavenConverter.asProfiles(getSettings().getProfiles());
}
代码示例来源:origin: shrinkwrap/resolver
private List<Profile> getSettingsDefinedProfiles() {
return MavenConverter.asProfiles(getSettings().getProfiles());
}
代码示例来源:origin: spring-projects/sts4
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;
}
代码示例来源:origin: org.kie.soup/kie-soup-maven-integration
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;
}
内容来源于网络,如有侵权,请联系作者删除!