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


Java PlexusContainer.lookup方法代码示例

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


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

示例1: rs

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
private static RepositorySystem rs( PlexusContainer c )
{
    try
    {
        return c.lookup( RepositorySystem.class );
    }
    catch ( ComponentLookupException e )
    {
        throw new IllegalStateException( e );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:12,代码来源:ProjectUtils.java

示例2: rss

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
private static RepositorySystemSession rss( PlexusContainer c )
{
    try
    {
        LegacySupport legacySupport = c.lookup( LegacySupport.class );

        return legacySupport.getRepositorySession();
    }
    catch ( ComponentLookupException e )
    {
        throw new IllegalStateException( e );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ProjectUtils.java

示例3: DefaultProfileManager

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
/**
 * the properties passed to the profile manager are the props that
 * are passed to maven, possibly containing profile activator properties
 *
 */
public DefaultProfileManager( PlexusContainer container, Properties props )
{
    try
    {
        this.profileSelector = container.lookup( ProfileSelector.class );
        this.logger = ( (MutablePlexusContainer) container ).getLogger();
    }
    catch ( ComponentLookupException e )
    {
        throw new IllegalStateException( e );
    }
    this.requestProperties = props;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:DefaultProfileManager.java

示例4: testDependencyInjection

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
public void testDependencyInjection()
    throws Exception
{
    PlexusContainer container = getContainer();

    ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd =
        new ComponentDescriptor<InjectDependencyLifecycleListener>( InjectDependencyLifecycleListener.class,
                                                                    container.getContainerRealm() );
    cd.setRoleClass( AbstractMavenLifecycleParticipant.class );
    container.addComponentDescriptor( cd );

    Maven maven = container.lookup( Maven.class );
    File pom = getProject( "lifecycle-listener-dependency-injection" );
    MavenExecutionRequest request = createMavenExecutionRequest( pom );
    request.setGoals( Arrays.asList( "validate" ) );
    MavenExecutionResult result = maven.execute( request );

    assertFalse( result.getExceptions().toString(), result.hasExceptions() );

    MavenProject project = result.getProject();
    
    assertEquals( "bar", project.getProperties().getProperty( "foo" ) );

    ArrayList<Artifact> artifacts = new ArrayList<Artifact>( project.getArtifacts() );

    assertEquals( 1, artifacts.size() );
    assertEquals( INJECTED_ARTIFACT_ID, artifacts.get( 0 ).getArtifactId() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:29,代码来源:MavenLifecycleParticipantTest.java

示例5: lookup

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
protected  <T> T lookup(PlexusContainer aether, Class<T> type) {
    try {
        return aether.lookup(type);
    } catch (ComponentLookupException e) {
        throw new RuntimeException("Unable to lookup component RepositorySystem, cannot establish Aether dependency resolver.", e);
    }
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:8,代码来源:RepositorySystemModule.java

示例6: setUp

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
@BeforeMethod
public void setUp() throws ComponentLookupException, PlexusContainerException {
    PlexusContainer container = new DefaultPlexusContainer();
    keysMap = container.lookup(KeysMap.class);
}
 
开发者ID:s4u,项目名称:pgpverify-maven-plugin,代码行数:6,代码来源:KeysMapTest.java

示例7: initTreeProcessing

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
public void initTreeProcessing( PlexusContainer plexus )
    throws ComponentLookupException
{
    classpathTransformation = (ClasspathTransformation) plexus.lookup( ClasspathTransformation.class );
    conflictResolver = (GraphConflictResolver) plexus.lookup( GraphConflictResolver.class );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:MetadataResolutionResult.java

示例8: createModelProcessor

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
protected ModelProcessor createModelProcessor( PlexusContainer container )
    throws ComponentLookupException
{
    return container.lookup( ModelProcessor.class );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:6,代码来源:MavenCli.java

示例9: createModelProcessor

import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
protected ModelProcessor createModelProcessor(PlexusContainer container)
        throws ComponentLookupException {
    return container.lookup(ModelProcessor.class);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:5,代码来源:AFMavenCli.java


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