Package org.codehaus.plexus

Examples of org.codehaus.plexus.PlexusContainer.lookup()


  // ------------------------------

  public final void contextualize(Context context) throws ContextException {
    PlexusContainer plexusContainer = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
    try {
      archiverManager = (ArchiverManager) plexusContainer.lookup(ArchiverManager.ROLE);
    } catch (ComponentLookupException e) {
      throw new ContextException(e.getMessage(), e);
    }
  }
View Full Code Here


            IMaven maven = MavenPlugin.getMaven();
            // first get the plexus container
            PlexusContainer container = ((MavenImpl) MavenPlugin.getMaven()).getPlexusContainer();

            // then get the DefaultMaven
            DefaultMaven mvn = (DefaultMaven) container.lookup(Maven.class);

            // now create a RepositorySystemSession
            MavenExecutionRequest request = new DefaultMavenExecutionRequest();
            request.setLocalRepository(maven.getLocalRepository());
View Full Code Here

            // We need to support Maven 3.0.x as well, so we use reflection to
            // access Aether APIs in a manner which is compatible with all Maven 3.x versions
            // See https://maven.apache.org/docs/3.1.0/release-notes.html
            MavenSession session = reflectiveCreateMavenSession(container, mvn, request);
            LegacySupport legacy = container.lookup(LegacySupport.class);
            legacy.setSession(session);

            // then lookup the DefaultArtifactInstaller
            DefaultArtifactInstaller dai = (DefaultArtifactInstaller) container.lookup(ArtifactInstaller.class);
View Full Code Here

            MavenSession session = reflectiveCreateMavenSession(container, mvn, request);
            LegacySupport legacy = container.lookup(LegacySupport.class);
            legacy.setSession(session);

            // then lookup the DefaultArtifactInstaller
            DefaultArtifactInstaller dai = (DefaultArtifactInstaller) container.lookup(ArtifactInstaller.class);

            final Set<Entry<String, InputStream>> entries = origins.entrySet();
            for (Iterator<Entry<String, InputStream>> it = entries.iterator(); it.hasNext();) {
                final Entry<String, InputStream> entry = it.next();
                final String fileExtension = entry.getKey();
View Full Code Here

        basedir.mkdirs();

        PlexusContainer container = new DefaultPlexusContainer();

        IndexCreator min = container.lookup( IndexCreator.class, "min" );
        IndexCreator jar = container.lookup( IndexCreator.class, "jarContent" );

        List<IndexCreator> creators = new ArrayList<IndexCreator>();
        creators.add( min );
        creators.add( jar );
View Full Code Here

        basedir.mkdirs();

        PlexusContainer container = new DefaultPlexusContainer();

        IndexCreator min = container.lookup( IndexCreator.class, "min" );
        IndexCreator jar = container.lookup( IndexCreator.class, "jarContent" );

        List<IndexCreator> creators = new ArrayList<IndexCreator>();
        creators.add( min );
        creators.add( jar );
View Full Code Here

        WagonFetcher wf = wh.getWagonResourceFetcher( tl, null, null );

        IndexUpdateRequest updateRequest = new IndexUpdateRequest( ctx, wf );

        container.lookup( IndexUpdater.class ).fetchAndUpdateIndex( updateRequest );
    }

}
View Full Code Here

    {
        final PlexusContainer container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );

        try
        {
            archiverManager = (ArchiverManager) container.lookup( ArchiverManager.ROLE );
        }
        catch ( final ComponentLookupException e )
        {
            throw new ContextException( "Error retrieving ArchiverManager instance: " + e.getMessage(), e );
        }
View Full Code Here

        SecuritySession securitySession =
            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY );

        try
        {
            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE );

            if ( !securitySystem.isAuthorized( securitySession, ContinuumRoleConstants.CONTINUUM_VIEW_GROUP_OPERATION,
                                               project.getProjectGroupName() ) )
            {
                return false;
View Full Code Here

        SecuritySession securitySession =
            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY );

        try
        {
            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE );

            if ( !securitySystem.isAuthorized( securitySession, ContinuumRoleConstants.CONTINUUM_VIEW_GROUP_OPERATION,
                                               projectGroupName ) )
            {
                return false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.