当前位置: 首页>>代码示例>>Java>>正文


Java Profile.getActivation方法代码示例

本文整理汇总了Java中org.apache.maven.settings.Profile.getActivation方法的典型用法代码示例。如果您正苦于以下问题:Java Profile.getActivation方法的具体用法?Java Profile.getActivation怎么用?Java Profile.getActivation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.settings.Profile的用法示例。


在下文中一共展示了Profile.getActivation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createModelProfiles

import org.apache.maven.settings.Profile; //导入方法依赖的package包/类
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;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:MavenSettings.java

示例2: repositoriesLegacy

import org.apache.maven.settings.Profile; //导入方法依赖的package包/类
private static List<ArtifactRepository> repositoriesLegacy(LegacyRepositorySystem legacy, Settings settings)
        throws InvalidRepositoryException {
    boolean central;
    List<ArtifactRepository> result;
    List<String> actives;
    ArtifactRepository artifactRepository;

    central = false;
    result = new ArrayList<>();
    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);
                if ("central".equals(artifactRepository.getId())) {
                    central = true;
                }
                result.add(artifactRepository);
            }
        }
    }
    if (!central) {
        /* Maven defines the default central repository in its master parent - and not in the default settings, which I'd prefer.
           As a consequent, central is not always defined when loading the settings.
           I first added central to repositories only, because legacy repositories are used to load poms which ultimatly load the
           master parent with it's repository definition. However, the parent might have to be loaded from central, so repositories
           also need a central definition. */
        result.add(legacy.createDefaultRemoteRepository());
    }
    return result;
}
 
开发者ID:mlhartme,项目名称:maven-embedded,代码行数:32,代码来源:Maven.java


注:本文中的org.apache.maven.settings.Profile.getActivation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。