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


Java ToolchainModel类代码示例

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


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

示例1: getToolchainFromBuildContext

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public Toolchain getToolchainFromBuildContext( String type, MavenSession session )
{
    Map<String, Object> context = retrieveContext( session );

    ToolchainModel model = (ToolchainModel) context.get( getStorageKey( type ) );

    if ( model != null )
    {
        try
        {
            ToolchainFactory fact = factories.get( type );
            if ( fact != null )
            {
                return fact.createToolchain( model );
            }
            else
            {
                logger.error( "Missing toolchain factory for type: " + type
                    + ". Possibly caused by misconfigured project." );
            }
        }
        catch ( MisconfiguredToolchainException ex )
        {
            logger.error( "Misconfigured toolchain.", ex );
        }
    }

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

示例2: getToolchainsForType

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public ToolchainPrivate[] getToolchainsForType( String type, MavenSession context )
    throws MisconfiguredToolchainException
{
    PersistedToolchains pers = toolchainsBuilder.build( context.getRequest().getUserToolchainsFile() );

    List<ToolchainPrivate> toRet = new ArrayList<ToolchainPrivate>();

    if ( pers != null )
    {
        List<ToolchainModel> lst = pers.getToolchains();
        if ( lst != null )
        {
            for ( ToolchainModel toolchainModel : lst )
            {
                ToolchainFactory fact = factories.get( toolchainModel.getType() );
                if ( fact != null )
                {
                    toRet.add( fact.createToolchain( toolchainModel ) );
                }
                else
                {
                    logger.error( "Missing toolchain factory for type: " + toolchainModel.getType()
                        + ". Possibly caused by misconfigured project." );
                }
            }
        }
    }

    for ( ToolchainFactory toolchainFactory : factories.values() )
    {
        ToolchainPrivate tool = toolchainFactory.createDefaultToolchain();
        if ( tool != null )
        {
            toRet.add( tool );
        }
    }

    return toRet.toArray( new ToolchainPrivate[toRet.size()] );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:DefaultToolchainManagerPrivate.java

示例3: createToolchain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public ToolchainPrivate createToolchain( final ToolchainModel model )
    throws MisconfiguredToolchainException
{
    if ( model == null )
        return null;

    final PathsToolchain pathsToolchain = new PathsToolchain( model, this.logger );
    final Properties provides = this.getProvidesProperties( model );
    for ( final Map.Entry<Object, Object> provide : provides.entrySet() )
    {
        final String key = (String) provide.getKey();
        final String value = (String) provide.getValue();
        if ( value == null )
            throw new MisconfiguredToolchainException( "Provides token '" + key
                + "' doesn't have any value configured." );

        pathsToolchain.addProvideToken( key, RequirementMatcherFactory.createExactMatcher( value ) );
    }

    final Xpp3Dom config = (Xpp3Dom) model.getConfiguration();
    if ( config == null )
        return pathsToolchain;

    final Xpp3Dom pathDom = config.getChild( "paths" );
    if ( pathDom == null )
        return pathsToolchain;

    final Xpp3Dom[] pathDoms = pathDom.getChildren( "path" );
    if ( pathDoms == null || pathDoms.length == 0 )
        return pathsToolchain;

    final List<String> paths = new ArrayList<String>( pathDoms.length );
    for ( final Xpp3Dom pathdom : pathDoms )
    {
        final String pathString = pathdom.getValue();

        if ( pathString == null )
            throw new MisconfiguredToolchainException( "path element is empty" );

        final String normalizedPath = FileUtils.normalize( pathString );
        final File file = new File( normalizedPath );
        if ( !file.exists() )
            throw new MisconfiguredToolchainException( "Non-existing path '" + file.getAbsolutePath() + "'" );

        paths.add( normalizedPath );
    }

    pathsToolchain.setPaths( paths );

    return pathsToolchain;
}
 
开发者ID:mojohaus,项目名称:exec-maven-plugin,代码行数:52,代码来源:PathsToolchainFactory.java

示例4: getProvidesProperties

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
protected Properties getProvidesProperties( final ToolchainModel model )
{
    final Object value = this.getBeanProperty( model, "provides" );

    return value instanceof Properties ? (Properties) value : toProperties( (Xpp3Dom) value );
}
 
开发者ID:mojohaus,项目名称:exec-maven-plugin,代码行数:7,代码来源:PathsToolchainFactory.java

示例5: PathsToolchain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public PathsToolchain( final ToolchainModel model, final Logger logger )
{
    super( model, "paths", logger ); // NOI18N
}
 
开发者ID:mojohaus,项目名称:exec-maven-plugin,代码行数:5,代码来源:PathsToolchain.java

示例6: DefaultCasperjsToolchain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
protected DefaultCasperjsToolchain(final ToolchainModel model, final Logger logger) {
    super(model, KEY_CASPERJS_TYPE, logger);
}
 
开发者ID:linsolas,项目名称:casperjs-runner-maven-plugin,代码行数:4,代码来源:DefaultCasperjsToolchain.java

示例7: DefaultToolchain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
protected DefaultToolchain( ToolchainModel model, Logger logger )
{
    this.model = model;

    this.logger = logger;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:DefaultToolchain.java

示例8: getModel

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public final ToolchainModel getModel()
{
    return model;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:5,代码来源:DefaultToolchain.java

示例9: DefaultJavaToolChain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public DefaultJavaToolChain( ToolchainModel model, Logger logger )
{
    super( model, "jdk", logger );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:5,代码来源:DefaultJavaToolChain.java

示例10: createToolchain

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
/**
 * Create instance of toolchain.
 **/
ToolchainPrivate createToolchain( ToolchainModel model )
    throws MisconfiguredToolchainException;
 
开发者ID:gems-uff,项目名称:oceano,代码行数:6,代码来源:ToolchainFactory.java

示例11: getModel

import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
ToolchainModel getModel(); 
开发者ID:gems-uff,项目名称:oceano,代码行数:2,代码来源:ToolchainPrivate.java


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