Examples of NexusIndexer


Examples of org.apache.maven.index.NexusIndexer

    public void cleanupIndex()
        throws Exception
    {
        log.info( "cleanup IndexingContext" );
        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
        for ( IndexingContext context : nexusIndexer.getIndexingContexts().values() )
        {
            nexusIndexer.removeIndexingContext( context, true );
        }

    }
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer

        throws RepositoryAdminException
    {

        try
        {
            NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );

            IndexingContext context = nexusIndexer.getIndexingContexts().get( repository.getId() );
            if ( context != null )
            {
                // delete content only if directory exists
                nexusIndexer.removeIndexingContext( context,
                                                    deleteContent && context.getIndexDirectoryFile().exists() );
            }
        }
        catch ( PlexusSisuBridgeException e )
        {
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer

  @Override
  public byte[] generateFile(RepositoryData data)
    throws Exception
  {
    NexusIndexer indexer = data.getIndexer();
    IndexingContext indexingContext = data.getIndexingContext();

        Query pq = indexer.constructQuery(MAVEN.PACKAGING, "deb", SearchType.EXACT);

        IteratorSearchRequest sreq = new IteratorSearchRequest(pq, indexingContext);
        IteratorSearchResponse hits = indexer.searchIterator(sreq);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OutputStreamWriter w = new OutputStreamWriter(baos);

        for (ArtifactInfo hit : hits) {
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer

    @Test
    public void testMavenIndexerLoad()
        throws Exception
    {
        NexusIndexer nexusIndexer = plexusShimComponent.lookup( NexusIndexer.class );
        Assert.assertNotNull( nexusIndexer );
    }
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer


    protected void removeMavenIndexes()
        throws Exception
    {
        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );

        for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
        {
            nexusIndexer.removeIndexingContext( indexingContext, false );
        }
    }
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer

        throws RepositoryAdminException
    {

        try
        {
            NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );

            IndexingContext context = nexusIndexer.getIndexingContexts().get( repository.getId() );
            if ( context != null )
            {
                // delete content only if directory exists
                nexusIndexer.removeIndexingContext( context,
                                                    deleteContent && context.getIndexDirectoryFile().exists() );
            }
        }
        catch ( PlexusSisuBridgeException e )
        {
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer


    protected void removeMavenIndexes()
        throws Exception
    {
        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );

        for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
        {
            nexusIndexer.removeIndexingContext( indexingContext, false );
        }
    }
View Full Code Here

Examples of org.apache.maven.index.NexusIndexer

    public void shutdown()
        throws Exception
    {

        log.info( "cleanup IndexingContext" );
        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
        for ( IndexingContext context : nexusIndexer.getIndexingContexts().values() )
        {
            nexusIndexer.removeIndexingContext( context, true );
        }
    }
View Full Code Here

Examples of org.sonatype.nexus.index.NexusIndexer

        String repositoryName = cli.hasOption( NAME ) ? cli.getOptionValue( NAME ) : indexDirectory.getName();

        File repository = new File( cli.getOptionValue( REPO ) );

        NexusIndexer indexer = (NexusIndexer) plexus.lookup( NexusIndexer.class );

        IndexPacker packer = (IndexPacker) plexus.lookup( IndexPacker.class );

        IndexingContext indexingContext = indexer.addIndexingContext( //
            repositoryName, // context id
            repositoryName, // repository id
            repository, // repository folder
            indexDirectory, // index folder
            null, // repositoryUrl
            null, // index update url
            indexers,
            false);

        boolean createZip = cli.hasOption( ZIP );

        boolean debug = cli.hasOption( DEBUG );

        boolean update = cli.hasOption( UPDATE );

        ArtifactScanningListener listener = new IndexerListener( indexingContext, packer, createZip, debug, update );

        indexer.scan( indexingContext, listener, update );
    }
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.