本文整理汇总了Java中org.codehaus.plexus.PlexusContainer类的典型用法代码示例。如果您正苦于以下问题:Java PlexusContainer类的具体用法?Java PlexusContainer怎么用?Java PlexusContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlexusContainer类属于org.codehaus.plexus包,在下文中一共展示了PlexusContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUpdateSession
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private ManipulationSession createUpdateSession() throws Exception
{
ManipulationSession session = new ManipulationSession();
session.setState( new DependencyState( p ) );
session.setState( new VersioningState( p ) );
session.setState( new CommonState( p ) );
final MavenExecutionRequest req =
new DefaultMavenExecutionRequest().setUserProperties( p ).setRemoteRepositories( Collections.<ArtifactRepository>emptyList() );
final PlexusContainer container = new DefaultPlexusContainer();
final MavenSession mavenSession = new MavenSession( container, null, req, new DefaultMavenExecutionResult() );
session.setMavenSession( mavenSession );
return session;
}
示例2: buildArtifactRepository
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
public static ArtifactRepository buildArtifactRepository( Repository repo,
ArtifactRepositoryFactory artifactRepositoryFactory,
PlexusContainer c )
throws InvalidRepositoryException
{
RepositorySystem repositorySystem = rs( c );
RepositorySystemSession session = rss( c );
ArtifactRepository repository = repositorySystem.buildArtifactRepository( repo );
if ( session != null )
{
repositorySystem.injectMirror( session, Arrays.asList( repository ) );
repositorySystem.injectProxy( session, Arrays.asList( repository ) );
repositorySystem.injectAuthentication( session, Arrays.asList( repository ) );
}
return repository;
}
示例3: MavenSession
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
@Deprecated
public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals,
String executionRootDir, Properties executionProperties, Properties userProperties,
Date startTime )
{
this.container = container;
this.settings = settings;
this.executionProperties = executionProperties;
this.request = new DefaultMavenExecutionRequest();
this.request.setUserProperties( userProperties );
this.request.setLocalRepository( localRepository );
this.request.setGoals( goals );
this.request.setBaseDirectory( ( executionRootDir != null ) ? new File( executionRootDir ) : null );
this.request.setStartTime( startTime );
}
示例4: aetherContainer
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
@Provides @Aether @Singleton
public PlexusContainer aetherContainer() {
try {
return new DefaultPlexusContainer(
new DefaultContainerConfiguration(),
new AbstractModule() {
@Override
protected void configure() {
bind(VersionResolver.class).to(VersionResolverImpl.class);
}
// DefaultSettingSettingsDecrypter looks for the "maven" name
@Provides @Singleton @Named("maven")
public SecDispatcher getDispatcher(DefaultSecDispatcher base) {
base.setConfigurationFile("~/.m2/settings-security.xml");
return base;
}
}
);
} catch (PlexusContainerException e) {
throw new RuntimeException("Unable to load RepositorySystem component by Plexus, cannot establish Aether dependency resolver.", e);
}
}
示例5: EmbedderConfiguration
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
EmbedderConfiguration(PlexusContainer cont, Properties props, Properties userprops, boolean offline, File settingsXml) {
this.cont = cont;
this.props = props;
this.offline = offline;
this.settingsXml = settingsXml;
this.userprops = userprops;
}
示例6: create
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
public static Maven2ServerEmbedderImpl create(MavenServerSettings facadeSettings) throws RemoteException {
MavenEmbedderSettings settings = new MavenEmbedderSettings();
List<String> commandLineOptions = new ArrayList<String>();
String mavenEmbedderCliOptions = System.getProperty(MavenServerEmbedder.MAVEN_EMBEDDER_CLI_ADDITIONAL_ARGS);
if (mavenEmbedderCliOptions != null) {
commandLineOptions.addAll(StringUtil.splitHonorQuotes(mavenEmbedderCliOptions, ' '));
}
settings.setConfigurator(new PlexusComponentConfigurator() {
public void configureComponents(@NotNull PlexusContainer c) {
setupContainer(c);
}
});
Maven2ServerConsoleWrapper consoleWrapper = new Maven2ServerConsoleWrapper();
consoleWrapper.setThreshold(facadeSettings.getLoggingLevel());
settings.setLogger(consoleWrapper);
settings.setRecursive(false);
settings.setWorkOffline(facadeSettings.isOffline());
settings.setUsePluginRegistry(false);
settings.setMavenHome(facadeSettings.getMavenHome());
settings.setUserSettingsFile(facadeSettings.getUserSettingsFile());
settings.setGlobalSettingsFile(facadeSettings.getGlobalSettingsFile());
settings.setLocalRepository(facadeSettings.getLocalRepository());
if (commandLineOptions.contains("-U") || commandLineOptions.contains("--update-snapshots")) {
settings.setSnapshotUpdatePolicy(MavenEmbedderSettings.UpdatePolicy.ALWAYS_UPDATE);
}
else {
settings.setSnapshotUpdatePolicy(convertUpdatePolicy(facadeSettings.getSnapshotUpdatePolicy()));
}
settings.setPluginUpdatePolicy(convertUpdatePolicy(facadeSettings.getPluginUpdatePolicy()));
settings.setProperties(MavenServerUtil.collectSystemProperties());
return new Maven2ServerEmbedderImpl(MavenEmbedder.create(settings), consoleWrapper);
}
示例7: setupContainer
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private static void setupContainer(PlexusContainer c) {
MavenEmbedder.setImplementation(c, ArtifactFactory.class, CustomArtifactFactory.class);
MavenEmbedder.setImplementation(c, ProjectArtifactFactory.class, CustomArtifactFactory.class);
MavenEmbedder.setImplementation(c, ArtifactResolver.class, CustomArtifactResolver.class);
MavenEmbedder.setImplementation(c, RepositoryMetadataManager.class, CustomRepositoryMetadataManager.class);
MavenEmbedder.setImplementation(c, WagonManager.class, CustomWagonManager.class);
MavenEmbedder.setImplementation(c, ModelInterpolator.class, CustomModelInterpolator.class);
}
示例8: customizeContainer
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
@Override
protected void customizeContainer(PlexusContainer container)
{
((DefaultPlexusContainer)container).setLoggerManager(
new BaseLoggerManager()
{
@Override
protected org.codehaus.plexus.logging.Logger createLogger(String s)
{
return new Slf4jLogger(LOG);
}
}
);
}
示例9: addProtocolProvider
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private void addProtocolProvider(CustomDeployTask deployTask) {
PlexusContainer plexusContainer = deployTask.getContainer();
for (File wagonProviderJar : getJars()) {
try {
plexusContainer.addJarResource(wagonProviderJar);
} catch (PlexusContainerException e) {
throw new RuntimeException(e);
}
}
}
示例10: setImplementation
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
public static <T> void setImplementation(PlexusContainer container, Class<T> componentClass, Class<? extends T> implementationClass) {
ComponentDescriptor d = container.getComponentDescriptor(componentClass.getName());
d.setImplementation(implementationClass.getName());
}
示例11: create
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
public static Maven2ServerEmbedderImpl create(MavenServerSettings facadeSettings) throws RemoteException {
MavenEmbedderSettings settings = new MavenEmbedderSettings();
settings.setConfigurator(new PlexusComponentConfigurator() {
public void configureComponents(@NotNull PlexusContainer c) {
setupContainer(c);
}
});
Maven2ServerConsoleWrapper consoleWrapper = new Maven2ServerConsoleWrapper();
consoleWrapper.setThreshold(facadeSettings.getLoggingLevel());
settings.setLogger(consoleWrapper);
settings.setRecursive(false);
settings.setWorkOffline(facadeSettings.isOffline());
settings.setUsePluginRegistry(false);
settings.setMavenHome(facadeSettings.getMavenHome());
settings.setUserSettingsFile(facadeSettings.getUserSettingsFile());
settings.setGlobalSettingsFile(facadeSettings.getGlobalSettingsFile());
settings.setLocalRepository(facadeSettings.getLocalRepository());
settings.setSnapshotUpdatePolicy(convertUpdatePolicy(facadeSettings.getSnapshotUpdatePolicy()));
settings.setPluginUpdatePolicy(convertUpdatePolicy(facadeSettings.getPluginUpdatePolicy()));
settings.setProperties(MavenServerUtil.collectSystemProperties());
return new Maven2ServerEmbedderImpl(MavenEmbedder.create(settings), consoleWrapper);
}
示例12: getProfileManager
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
/**
* Convenience method to get the {@link ProfileManager} for a given
* {@link MavenSession}.
*/
@SuppressWarnings("deprecation")
private static ProfileManager getProfileManager(final MavenSession session) {
final PlexusContainer container = session.getContainer();
final Properties execution = session.getExecutionProperties();
return new DefaultProfileManager(container, execution);
}
示例13: setupSession
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private VersioningState setupSession( final Properties properties, final Map<ProjectRef, String[]> versionMap )
throws Exception
{
final ArtifactRepository ar =
new MavenArtifactRepository( "test", "http://repo.maven.apache.org/maven2", new DefaultRepositoryLayout(),
new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy() );
final MavenExecutionRequest req =
new DefaultMavenExecutionRequest().setUserProperties( properties )
.setRemoteRepositories( Arrays.asList( ar ) );
final PlexusContainer container = new DefaultPlexusContainer();
final MavenSession mavenSession = new MavenSession( container, null, req, new DefaultMavenExecutionResult() );
session = new ManipulationSession();
session.setMavenSession( mavenSession );
final VersioningState state = new VersioningState( properties );
session.setState( state );
final Map<String, byte[]> dataMap = new HashMap<>();
if ( versionMap != null && !versionMap.isEmpty() )
{
for ( final Map.Entry<ProjectRef, String[]> entry : versionMap.entrySet() )
{
final String path = toMetadataPath( entry.getKey() );
final byte[] data = setupMetadataVersions( entry.getValue() );
dataMap.put( path, data );
}
}
final Location mdLoc = MavenLocationExpander.EXPANSION_TARGET;
final Transport mdTrans = new StubTransport( dataMap );
modder =
new TestVersionCalculator( new ManipulationSession(), mdLoc, mdTrans, temp.newFolder( "galley-cache" ) );
return state;
}
示例14: setMavenSession
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private void setMavenSession()
throws Exception
{
final MavenExecutionRequest req =
new DefaultMavenExecutionRequest().setUserProperties( userCliProperties )
.setRemoteRepositories( Collections.<ArtifactRepository> emptyList() );
final PlexusContainer container = new DefaultPlexusContainer();
final MavenSession mavenSession = new MavenSession( container, null, req, new DefaultMavenExecutionResult() );
session.setMavenSession( mavenSession );
}
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:14,代码来源:DistributionEnforcingManipulatorTest.java
示例15: initContainer
import org.codehaus.plexus.PlexusContainer; //导入依赖的package包/类
private static PlexusContainer initContainer()
{
try
{
return new DefaultPlexusContainer();
}
catch(PlexusContainerException e)
{
log.error("Error initializing Maven", e);
return null;
}
}