本文整理了Java中org.apache.maven.settings.Profile.getActivation()
方法的一些代码示例,展示了Profile.getActivation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.getActivation()
方法的具体详情如下:
包路径:org.apache.maven.settings.Profile
类名称:Profile
方法名:getActivation
[英]Get the conditional logic which will automatically trigger the inclusion of this profile.
[中]获取将自动触发包含此配置文件的条件逻辑。
代码示例来源:origin: apache/maven
if ( profile.getActivation() != null )
writeActivation( (Activation) profile.getActivation(), "activation", serializer );
代码示例来源:origin: apache/maven
Activation settingsActivation = settingsProfile.getActivation();
代码示例来源:origin: org.apache.maven/maven-settings
if ( profile.getActivation() != null )
writeActivation( (Activation) profile.getActivation(), "activation", serializer );
代码示例来源:origin: org.uberfire/uberfire-maven-integration
private boolean isProfileActive( Profile profile ) {
return settings.getActiveProfiles().contains( profile.getId() ) ||
( profile.getActivation() != null && profile.getActivation().isActiveByDefault() );
}
代码示例来源:origin: org.kie.soup/kie-soup-maven-integration
private boolean isProfileActive( Profile profile ) {
return settings.getActiveProfiles().contains( profile.getId() ) ||
( profile.getActivation() != null && profile.getActivation().isActiveByDefault() );
}
代码示例来源:origin: spring-cloud/spring-cloud-function
private List<org.apache.maven.model.Profile> createModelProfiles(
List<Profile> profiles) {
List<org.apache.maven.model.Profile> modelProfiles = new ArrayList<org.apache.maven.model.Profile>();
for (Profile profile : profiles) {
org.apache.maven.model.Profile modelProfile = new org.apache.maven.model.Profile();
modelProfile.setId(profile.getId());
if (profile.getActivation() != null) {
modelProfile
.setActivation(createModelActivation(profile.getActivation()));
}
modelProfiles.add(modelProfile);
}
return modelProfiles;
}
代码示例来源: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.springframework.boot/spring-boot-cli
private List<org.apache.maven.model.Profile> createModelProfiles(
List<Profile> profiles) {
List<org.apache.maven.model.Profile> modelProfiles = new ArrayList<>();
for (Profile profile : profiles) {
org.apache.maven.model.Profile modelProfile = new org.apache.maven.model.Profile();
modelProfile.setId(profile.getId());
if (profile.getActivation() != null) {
modelProfile
.setActivation(createModelActivation(profile.getActivation()));
}
modelProfiles.add(modelProfile);
}
return modelProfiles;
}
代码示例来源:origin: org.springframework.boot.experimental/spring-boot-thin-launcher
private List<org.apache.maven.model.Profile> createModelProfiles(
List<Profile> profiles) {
List<org.apache.maven.model.Profile> modelProfiles = new ArrayList<org.apache.maven.model.Profile>();
for (Profile profile : profiles) {
org.apache.maven.model.Profile modelProfile = new org.apache.maven.model.Profile();
modelProfile.setId(profile.getId());
if (profile.getActivation() != null) {
modelProfile
.setActivation(createModelActivation(profile.getActivation()));
}
modelProfiles.add(modelProfile);
}
return modelProfiles;
}
代码示例来源:origin: io.fabric8/maven-util
public static List<Repository> getRepositories() {
List<Repository> repositories = new LinkedList<Repository>();
Settings settings = getSettings();
Set<String> profileNames = new LinkedHashSet<String>();
profileNames.addAll(settings.getActiveProfiles());
for (Profile p : settings.getProfiles()) {
if (p.getActivation() != null && p.getActivation().isActiveByDefault()) {
profileNames.add(p.getId());
}
}
for (String profileName : profileNames) {
Object obj = settings.getProfilesAsMap().get(profileName);
if (Profile.class.isAssignableFrom(obj.getClass())) {
Profile p = (Profile) obj;
for (Repository repository : p.getRepositories()) {
repositories.add(repository);
}
}
}
return repositories;
}
代码示例来源:origin: org.fusesource/maven-util
public static List<Repository> getRepositories() {
List<Repository> repositories = new LinkedList<Repository>();
Settings settings = getSettings();
Set<String> profileNames = new LinkedHashSet<String>();
profileNames.addAll(settings.getActiveProfiles());
for (Profile p : settings.getProfiles()) {
if (p.getActivation() != null && p.getActivation().isActiveByDefault()) {
profileNames.add(p.getId());
}
}
for (String profileName : profileNames) {
Object obj = settings.getProfilesAsMap().get(profileName);
if (Profile.class.isAssignableFrom(obj.getClass())) {
Profile p = (Profile) obj;
for (Repository repository : p.getRepositories()) {
repositories.add(repository);
}
}
}
return repositories;
}
代码示例来源:origin: io.teecube.t3/t3-common
private List<String> getActiveProfiles(Settings settings) {
if (settings == null) return null;
List<String> result = settings.getActiveProfiles();
if (result == null) {
result = new ArrayList<String>();
}
if (settings.getProfiles() != null) {
for (Profile profile : settings.getProfiles()) {
if (!result.contains(profile.getId())) {
if (profile.getActivation() != null && profile.getActivation().isActiveByDefault()) {
result.add(profile.getId());
}
}
}
}
return result;
}
代码示例来源:origin: io.squark.yggdrasil/yggdrasil-maven-provider
if (activeMavenProfiles.size() == 0) {
for (Map.Entry<String, Profile> profile : mavenProfiles.entrySet()) {
if (profile.getValue().getActivation() != null && profile.getValue().getActivation().isActiveByDefault()) {
activeMavenProfiles.add(profile.getKey());
代码示例来源:origin: opoo/opoopress
private String getPropertyValue(String propertyName) throws MojoFailureException {
Map<String, Profile> profiles = settings.getProfilesAsMap();
List<String> activeProfiles = settings.getActiveProfiles();
for(String id: activeProfiles){
Profile profile = profiles.get(id);
if(profile != null){
Properties properties = profile.getProperties();
if(properties != null){
String property = properties.getProperty(propertyName);
if(property != null){
getLog().info("Resolve deploy repository url: " + propertyName + " => " + property);
return property;
}
}
}
}
for(Profile profile: settings.getProfiles()){
if(profile.getActivation() != null && profile.getActivation().isActiveByDefault()){
Properties properties = profile.getProperties();
if(properties != null){
String property = properties.getProperty(propertyName);
if(property != null){
getLog().info("Resolve deploy repository url: " + propertyName + " => " + property);
return property;
}
}
}
}
throw new MojoFailureException("Can not resolve deploy repository url: " + propertyName);
}
代码示例来源:origin: net.oneandone.maven/embedded
actives = settings.getActiveProfiles();
for (Profile profile : settings.getProfiles()) {
if (actives.contains(profile.getId()) || (profile.getActivation() != null && profile.getActivation().isActiveByDefault())) {
for (org.apache.maven.model.Repository repository : SettingsUtils.convertFromSettingsProfile(profile).getRepositories()) {
artifactRepository = legacy.buildArtifactRepository(repository);
代码示例来源:origin: apache/karaf
Map<String, Profile> profiles = (Map<String, Profile>)mavenSettings.getProfilesAsMap();
profiles.values().stream()
.filter((profile) -> profile.getActivation() != null && profile.getActivation().isActiveByDefault())
.map(Profile::getId)
.forEach(activeProfiles::add);
代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven
public static Profile asProfile(org.apache.maven.settings.Profile profile) {
Profile mavenProfile = new Profile();
if (profile != null) {
mavenProfile.setId(profile.getId());
mavenProfile.setActivation(asActivation(profile.getActivation()));
mavenProfile.setProperties(profile.getProperties());
mavenProfile.setRepositories(asRepositories(profile.getRepositories()));
mavenProfile.setPluginRepositories(asRepositories(profile.getPluginRepositories()));
}
return mavenProfile;
}
代码示例来源:origin: shrinkwrap/resolver
public static Profile asProfile(org.apache.maven.settings.Profile profile) {
Profile mavenProfile = new Profile();
if (profile != null) {
mavenProfile.setId(profile.getId());
mavenProfile.setActivation(asActivation(profile.getActivation()));
mavenProfile.setProperties(profile.getProperties());
mavenProfile.setRepositories(asRepositories(profile.getRepositories()));
mavenProfile.setPluginRepositories(asRepositories(profile.getPluginRepositories()));
}
return mavenProfile;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder
/**
* Method updateProfile.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
updateActivation( value.getActivation(), "activation", innerCount, root);
findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
} //-- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder
/**
* Method updateProfile
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
updateActivation( value.getActivation(), "activation", innerCount, root);
findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
} //-- void updateProfile(Profile, String, Counter, Element)
内容来源于网络,如有侵权,请联系作者删除!