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


Java ModelProblemCollectorRequest类代码示例

本文整理汇总了Java中org.apache.maven.model.building.ModelProblemCollectorRequest的典型用法代码示例。如果您正苦于以下问题:Java ModelProblemCollectorRequest类的具体用法?Java ModelProblemCollectorRequest怎么用?Java ModelProblemCollectorRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModelProblemCollectorRequest类属于org.apache.maven.model.building包,在下文中一共展示了ModelProblemCollectorRequest类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectLifecycleBindings

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
public void injectLifecycleBindings( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
    String packaging = model.getPackaging();

    Collection<Plugin> defaultPlugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles( packaging );

    if ( defaultPlugins == null )
    {
        problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE)
                .setMessage( "Unknown packaging: " + packaging )
                .setLocation( model.getLocation( "packaging" )));
    }
    else if ( !defaultPlugins.isEmpty() )
    {
        Model lifecycleModel = new Model();
        lifecycleModel.setBuild( new Build() );
        lifecycleModel.getBuild().getPlugins().addAll( defaultPlugins );

        merger.merge( model, lifecycleModel );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:22,代码来源:DefaultLifecycleBindingsInjector.java

示例2: isActive

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
private boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
    for ( ProfileActivator activator : activators )
    {
        try
        {
            if ( activator.isActive( profile, context, problems ) )
            {
                return true;
            }
        }
        catch ( RuntimeException e )
        {
            problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE)
                    .setMessage( "Failed to determine activation for profile " + profile.getId())
                    .setLocation( profile.getLocation( "" ))
                    .setException( e ));
            return false;
        }
    }
    return false;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:DefaultProfileSelector.java

示例3: getValue

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
public Object getValue( String expression )
{
    Object value = valueSource.getValue( expression );

    if ( value != null && expression.startsWith( bannedPrefix ) )
    {
        String msg = "The expression ${" + expression + "} is deprecated.";
        if ( newPrefix != null && newPrefix.length() > 0 )
        {
            msg += " Please use ${" + newPrefix + expression.substring( bannedPrefix.length() ) + "} instead.";
        }
        problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V20 ).setMessage( msg ));
    }

    return value;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:ProblemDetectingValueSource.java

示例4: createFailureMessage

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
private String createFailureMessage(
		SpringBootCliModelProblemCollector problemCollector) {
	StringWriter message = new StringWriter();
	PrintWriter printer = new PrintWriter(message);
	printer.println("Failed to determine active profiles:");
	for (ModelProblemCollectorRequest problem : problemCollector.getProblems()) {
		printer.println("    " + problem.getMessage() + (problem.getLocation() != null
				? " at " + problem.getLocation() : ""));
		if (problem.getException() != null) {
			printer.println(indentStackTrace(problem.getException(), "        "));
		}
	}
	return message.toString();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:MavenSettings.java

示例5: createFailureMessage

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
private String createFailureMessage(
		SpringBootCliModelProblemCollector problemCollector) {
	StringWriter message = new StringWriter();
	PrintWriter printer = new PrintWriter(message);
	printer.println("Failed to determine active profiles:");
	for (ModelProblemCollectorRequest problem : problemCollector.getProblems()) {
		printer.println(
				"    " + problem.getMessage() + " at " + problem.getLocation());
	}
	return message.toString();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:MavenSettings.java

示例6: add

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
public void add( ModelProblemCollectorRequest req )
{
    if ( !ModelProblem.Severity.WARNING.equals( req.getSeverity() ) )
    {
        result.addMessage( req.getMessage() );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:DefaultModelValidator.java

示例7: getActiveProfiles

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
public List getActiveProfiles()
    throws ProfileActivationException
{
    DefaultProfileActivationContext context = new DefaultProfileActivationContext();
    context.setActiveProfileIds( activatedIds );
    context.setInactiveProfileIds( deactivatedIds );
    context.setSystemProperties( System.getProperties() );
    context.setUserProperties( requestProperties );

    final List<ProfileActivationException> errors = new ArrayList<ProfileActivationException>();

    List<Profile> profiles =
        profileSelector.getActiveProfiles( profilesById.values(), context, new ModelProblemCollector()
        {

            public void add( ModelProblemCollectorRequest req )
            {
                if ( !ModelProblem.Severity.WARNING.equals( req.getSeverity() ) )
                {
                    errors.add( new ProfileActivationException( req.getMessage(), req.getException() ) );
                }
            }
        } );

    if ( !errors.isEmpty() )
    {
        throw errors.get( 0 );
    }

    return profiles;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:32,代码来源:DefaultProfileManager.java

示例8: addViolation

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
private static void addViolation( ModelProblemCollector problems, Severity severity, Version version, String fieldName,
                                  String sourceHint, String message, InputLocationTracker tracker )
{
    StringBuilder buffer = new StringBuilder( 256 );
    buffer.append( '\'' ).append( fieldName ).append( '\'' );

    if ( sourceHint != null )
    {
        buffer.append( " for " ).append( sourceHint );
    }

    buffer.append( ' ' ).append( message );

    problems.add( new ModelProblemCollectorRequest( severity, version ).setMessage( buffer.toString() ).setLocation( getLocation( fieldName, tracker )));
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:16,代码来源:DefaultModelValidator.java

示例9: isActive

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
    Activation activation = profile.getActivation();

    if ( activation == null )
    {
        return false;
    }

    String jdk = activation.getJdk();

    if ( jdk == null )
    {
        return false;
    }

    String version = context.getSystemProperties().get( "java.version" );

    if ( version == null || version.length() <= 0 )
    {
        problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
                .setMessage( "Failed to determine Java version for profile " + profile.getId() )
                .setLocation(activation.getLocation( "jdk" ) ) );
        return false;
    }

    if ( jdk.startsWith( "!" ) )
    {
        return !version.startsWith( jdk.substring( 1 ) );
    }
    else if ( isRange( jdk ) )
    {
        return isInRange( version, getRange( jdk ) );
    }
    else
    {
        return version.startsWith( jdk );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:JdkVersionProfileActivator.java

示例10: add

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
@Override
public void add(ModelProblemCollectorRequest req) {
	this.problems.add(req);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:MavenSettings.java

示例11: getProblems

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
List<ModelProblemCollectorRequest> getProblems() {
	return this.problems;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:MavenSettings.java

示例12: add

import org.apache.maven.model.building.ModelProblemCollectorRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void add( ModelProblemCollectorRequest req )
{
    this.logger.warn( req.getMessage(), req.getException() );
}
 
开发者ID:mojohaus,项目名称:flatten-maven-plugin,代码行数:8,代码来源:LoggingModelProblemCollector.java


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