热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.maven.settings.Profile类的使用及代码示例

本文整理了Java中org.apache.maven.settings.Profile类的一些代码示例,展示了Profile类的具体用法。这些

本文整理了Java中org.apache.maven.settings.Profile类的一些代码示例,展示了Profile类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile类的具体详情如下:
包路径:org.apache.maven.settings.Profile
类名称:Profile

Profile介绍

[英]Modifications to the build process which is keyed on some sort of environmental parameter.
[中]对构建过程的修改取决于某种环境参数。

代码示例

代码示例来源:origin: apache/maven

if ( profile.getActivation() != null )
writeActivation( (Activation) profile.getActivation(), "activation", serializer );
if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) )
for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); )
String value = (String) profile.getProperties().get( key );
serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )
if ( ( profile.getPluginRepositories() != null ) && ( profile.getPluginRepositories().size() > 0 ) )
for ( Iterator iter = profile.getPluginRepositories().iterator(); iter.hasNext(); )
if ( ( profile.getId() != null ) && !profile.getId().equals( "default" ) )
serializer.startTag( NAMESPACE, "id" ).text( profile.getId() ).endTag( NAMESPACE, "id" );

代码示例来源:origin: apache/maven

Profile profile = new Profile();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
profile.setActivation( parseActivation( parser, strict ) );
profile.addProperty( key, value );
profile.setRepositories( repositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
profile.setPluginRepositories( pluginRepositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
profile.setId( interpolatedTrimmed( parser.nextText(), "id" ) );

代码示例来源:origin: apache/maven

if ( !profileIds.add( profile.getId() ) )
"must be unique but found duplicate profile with id " + profile.getId() );
String prefix = "profiles.profile[" + profile.getId() + "].";
validateRepositories( problems, profile.getRepositories(), prefix + "repositories.repository" );
validateRepositories( problems, profile.getPluginRepositories(), prefix
+ "pluginRepositories.pluginRepository" );

代码示例来源:origin: io.fabric8/maven-util

public static List getRepositories() {
List repositories = new LinkedList();
Settings settings = getSettings();
Set profileNames = new LinkedHashSet();
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.uberfire/uberfire-maven-integration

private boolean isProfileActive( Profile profile ) {
return settings.getActiveProfiles().contains( profile.getId() ) ||
( profile.getActivation() != null && profile.getActivation().isActiveByDefault() );
}

代码示例来源:origin: apache/maven

/**
* Method addRepository.
*
* @param repository
*/
public void addRepository( Repository repository )
{
getRepositories().add( repository );
} //-- void addRepository( Repository )

代码示例来源:origin: org.jboss.forge.addon/maven-api

public ProfileAdapter(final org.apache.maven.settings.Profile profile)
{
setId(profile.getId());
Activation activation = new Activation();
setActivation(activation);
for (org.apache.maven.settings.Repository repository : profile.getRepositories())
{
Repository mavenRepository = new Repository();
mavenRepository.setId(repository.getId());
mavenRepository.setUrl(repository.getUrl());
getRepositories().add(mavenRepository);
}
setProperties(profile.getProperties());
}

代码示例来源:origin: apache/maven

/**
* @return a Map of profiles field with Profile#getId() as key
* @see org.apache.maven.settings.Profile#getId()
*/
public java.util.Map getProfilesAsMap()
{
if ( profileMap == null )
{
profileMap = new java.util.LinkedHashMap();
if ( getProfiles() != null )
{
for ( Profile profile : getProfiles() )
{
profileMap.put( profile.getId(), profile );
}
}
}
return profileMap;
}

代码示例来源:origin: io.squark.yggdrasil/yggdrasil-maven-provider

if (activeMavenProfiles.size() == 0) {
for (Map.Entry profile : mavenProfiles.entrySet()) {
if (profile.getValue().getActivation() != null && profile.getValue().getActivation().isActiveByDefault()) {
activeMavenProfiles.add(profile.getKey());
for (String activeProfile : activeMavenProfiles) {
Profile profile = mavenProfiles.get(activeProfile);
List profileRepositories = profile.getRepositories();
for (Repository repository : profileRepositories) {
RemoteRepository remoteRepository = new RemoteRepository.Builder(repository.getId(), "default",

代码示例来源:origin: apache/karaf

if (profile.getRepositories().stream().anyMatch((r) -> id.equals(r.getId()))) {
List newRepos = profile.getRepositories().stream()
.filter((r) -> !id.equals(r.getId())).collect(Collectors.toList());
profile.setRepositories(newRepos);
System.out.printf("Repository with ID \"%s\" was removed from profile \"%s\"\n", id, profile.getId());
break;

代码示例来源:origin: org.kie.soup/kie-soup-maven-integration

private Collection initExtraRepositories() {
Collection extraRepositories = new HashSet();
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;
}

代码示例来源:origin: com.itemis.maven.plugins/unleash-maven-plugin

if (!this.profiles.contains(profile.getId())) {
continue;
for (Map.Entry entry : profile.getProperties().entrySet()) {
this.properties.put((String) entry.getKey(), (String) entry.getValue());

代码示例来源:origin: org.eclipse.hudson.main/maven3-eventspy-3.0

private static void logSettingsProfileList( List profiles, String type )
{
log.debug( String.format( "%s %s profiles.", type, profiles.size() ) );
for ( org.apache.maven.settings.Profile profile : profiles )
{
log.debug( " {}", String.format("Profile {id: %s, source: %s}", profile.getId(), profile.getSourceLevel() ) );
}
}
}

代码示例来源:origin: org.springframework.boot/spring-boot-cli

private static void addActiveProfileRepositories(List activeProfiles,
List configurations) {
for (Profile activeProfile : activeProfiles) {
Interpolator interpolator = new RegexBasedInterpolator();
interpolator.addValueSource(
new PropertiesBasedValueSource(activeProfile.getProperties()));
for (Repository repository : activeProfile.getRepositories()) {
configurations.add(getRepositoryConfiguration(interpolator, repository));
}
}
}

代码示例来源:origin: opoo/opoopress

private String getPropertyValue(String propertyName) throws MojoFailureException {
Map profiles = settings.getProfilesAsMap();
List 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: apache/maven

Profile profile = new Profile();
profile.setId( modelProfile.getId() );
profile.setActivation( activation );
profile.setProperties( modelProfile.getProperties() );
profile.addRepository( convertToSettingsRepository( repo ) );
profile.addPluginRepository( convertToSettingsRepository( pluginRepo ) );

代码示例来源:origin: apache/maven

/**
* Method addProperty.
*
* @param key
* @param value
*/
public void addProperty( String key, String value )
{
getProperties().put( key, value );
} //-- void addProperty( String, String )

代码示例来源:origin: io.teecube.t3/t3-site-enhancer

public org.apache.maven.settings.Profile getFullSampleProfile(String id, Properties profileProperties) {
org.apache.maven.settings.Profile profile = new org.apache.maven.settings.Profile();
profile.setId(id);
for (GlobalParameter globalParameter : globalParameters) {
if (!globalParameter.valueGuessedByDefault) {
String value;
if (profileProperties.containsKey(globalParameter.property)) {
value = profileProperties.getProperty(globalParameter.property);
} else {
value = "[...]";
}
profile.getProperties().put(globalParameter.property, value);
}
}
return profile;
}

代码示例来源:origin: apache/maven

/**
* Method addPluginRepository.
*
* @param repository
*/
public void addPluginRepository( Repository repository )
{
getPluginRepositories().add( repository );
} //-- void addPluginRepository( Repository )

代码示例来源:origin: org.codehaus.mevenide/nb-project

Profile myProfile = new Profile();
if (repoRoot != null) {
myProfile.setId(PROFILE_PUBLIC);//NOI18N
Repository repo = new Repository();
repo.setUrl("file://" + repoRoot.getAbsolutePath());//NOI18N
repo.setSnapshots(snap);
repo.setName("NetBeans IDE internal Repository hosting plugins that are executable in NetBeans IDE only.");//NOI18N
myProfile.addPluginRepository(repo);
Activation act = new Activation();
ActivationProperty prop = new ActivationProperty();
prop.setValue("true");//NOI18N
act.setProperty(prop);
myProfile.setActivation(act);

推荐阅读
  • 深入解析SpringMVC核心组件:DispatcherServlet的工作原理
    本文详细探讨了SpringMVC的核心组件——DispatcherServlet的运作机制,旨在帮助有一定Java和Spring基础的开发人员理解HTTP请求是如何被映射到Controller并执行的。文章将解答以下问题:1. HTTP请求如何映射到Controller;2. Controller是如何被执行的。 ... [详细]
  • Struts与Spring框架的集成指南
    本文详细介绍了如何将Struts和Spring两个流行的Java Web开发框架进行整合,涵盖从环境配置到代码实现的具体步骤。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 本文介绍了两种方法,用于检测 Android 设备是否开启了开发者模式。第一种方法通过检查 USB 调试模式的状态,第二种方法则直接判断开发者选项是否启用。这两种方法均提供了代码示例和详细解释。 ... [详细]
  • 解决JAX-WS动态客户端工厂弃用问题并迁移到XFire
    在处理Java项目中的JAR包冲突时,我们遇到了JaxWsDynamicClientFactory被弃用的问题,并成功将其迁移到org.codehaus.xfire.client。本文详细介绍了这一过程及解决方案。 ... [详细]
  • 本文详细介绍如何利用已搭建的LAMP(Linux、Apache、MySQL、PHP)环境,快速创建一个基于WordPress的内容管理系统(CMS)。WordPress是一款流行的开源博客平台,适用于个人或小型团队使用。 ... [详细]
  • 采用IKE方式建立IPsec安全隧道
    一、【组网和实验环境】按如上的接口ip先作配置,再作ipsec的相关配置,配置文本见文章最后本文实验采用的交换机是H3C模拟器,下载地址如 ... [详细]
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • 在当前众多持久层框架中,MyBatis(前身为iBatis)凭借其轻量级、易用性和对SQL的直接支持,成为许多开发者的首选。本文将详细探讨MyBatis的核心概念、设计理念及其优势。 ... [详细]
  • This pull request introduces the ability to provide comprehensive paragraph configurations directly within the Create Note and Create Paragraph REST endpoints, reducing the need for additional configuration calls. ... [详细]
  • 解决FCKeditor应用主题后上传问题及优化配置
    本文介绍了在Freetextbox收费后选择FCKeditor作为替代方案时遇到的上传问题及其解决方案。通过调整配置文件和调试工具,最终解决了上传失败的问题,并对相关配置进行了优化。 ... [详细]
  • 利用决策树预测NBA比赛胜负的Python数据挖掘实践
    本文通过使用2013-14赛季NBA赛程与结果数据集以及2013年NBA排名数据,结合《Python数据挖掘入门与实践》一书中的方法,展示如何应用决策树算法进行比赛胜负预测。我们将详细讲解数据预处理、特征工程及模型评估等关键步骤。 ... [详细]
author-avatar
追梦的青春灬_176
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有