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


Java PlexusContainer类代码示例

本文整理汇总了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;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:19,代码来源:PropertiesUtilsTest.java

示例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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:20,代码来源:ProjectUtils.java

示例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 );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:MavenSession.java

示例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);
    }
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:24,代码来源:RepositorySystemModule.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:EmbedderConfiguration.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:Maven2ServerEmbedderImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:Maven2ServerEmbedderImpl.java

示例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);
        }
      }
  );
}
 
开发者ID:apache,项目名称:apex-core,代码行数:15,代码来源:StramTestSupport.java

示例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);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:BaseMavenDeployer.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:MavenEmbedder.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:Maven2ServerEmbedderImpl.java

示例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);
}
 
开发者ID:scijava,项目名称:scijava-maven-plugin,代码行数:11,代码来源:DependencyUtils.java

示例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;
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:41,代码来源:VersioningCalculatorTest.java

示例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;
	}
}
 
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:13,代码来源:Maven.java


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