本文整理汇总了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;
}
示例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()] );
}
示例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;
}
示例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 );
}
示例5: PathsToolchain
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public PathsToolchain( final ToolchainModel model, final Logger logger )
{
super( model, "paths", logger ); // NOI18N
}
示例6: DefaultCasperjsToolchain
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
protected DefaultCasperjsToolchain(final ToolchainModel model, final Logger logger) {
super(model, KEY_CASPERJS_TYPE, logger);
}
示例7: DefaultToolchain
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
protected DefaultToolchain( ToolchainModel model, Logger logger )
{
this.model = model;
this.logger = logger;
}
示例8: getModel
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public final ToolchainModel getModel()
{
return model;
}
示例9: DefaultJavaToolChain
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
public DefaultJavaToolChain( ToolchainModel model, Logger logger )
{
super( model, "jdk", logger );
}
示例10: createToolchain
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
/**
* Create instance of toolchain.
**/
ToolchainPrivate createToolchain( ToolchainModel model )
throws MisconfiguredToolchainException;
示例11: getModel
import org.apache.maven.toolchain.model.ToolchainModel; //导入依赖的package包/类
ToolchainModel getModel();