本文整理汇总了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 );
}
}
示例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 );
}
}
示例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;
}
示例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() );
}
示例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);
}
}
示例6: setUp
import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
@BeforeMethod
public void setUp() throws ComponentLookupException, PlexusContainerException {
PlexusContainer container = new DefaultPlexusContainer();
keysMap = container.lookup(KeysMap.class);
}
示例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 );
}
示例8: createModelProcessor
import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
protected ModelProcessor createModelProcessor( PlexusContainer container )
throws ComponentLookupException
{
return container.lookup( ModelProcessor.class );
}
示例9: createModelProcessor
import org.codehaus.plexus.PlexusContainer; //导入方法依赖的package包/类
protected ModelProcessor createModelProcessor(PlexusContainer container)
throws ComponentLookupException {
return container.lookup(ModelProcessor.class);
}