Package org.apache.maven.archiva.consumers

Examples of org.apache.maven.archiva.consumers.ConsumerException


            this.repositoryDir = new File( repository.getRepoRoot() );
            this.whenGathered = whenGathered;
        }
        catch(RepositoryException e)
        {
            throw new ConsumerException( "Unable to start ArtifactUpdateDatabaseConsumer: " + e.getMessage(), e );
        }
    }
View Full Code Here


            this.repositoryDir = new File( repository.getRepoRoot() );
            this.scanStartTimestamp = System.currentTimeMillis();
        }
        catch ( RepositoryNotFoundException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        catch ( RepositoryException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
View Full Code Here

                                                                        localRepository.toURL().toExternalForm(),
                                                                        layout, null, null );
            }
            catch ( MalformedURLException e )
            {
                throw new ConsumerException( e.getMessage(), e );
            }
        }
    }
View Full Code Here

            // manually flush out the cache for memory concerns and more accurate building
            flushProjectCache( projectBuilder );
        }
        catch ( ProjectBuildingException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }

        DependencyNode rootNode;
        try
        {
            // TODO: do this for different values of new ScopeArtifactFilter( scope )
            ArtifactFilter artifactFilter = null;

            rootNode =
                dependencyTreeBuilder.buildDependencyTree( project, localArtifactRepository, artifactFactory,
                                                           artifactMetadataSource, artifactFilter, artifactCollector );
        }
        catch ( DependencyTreeBuilderException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }

        Document document = DocumentHelper.createDocument();
        DependencyNodeVisitor visitor = new XmlSerializingDependencyNodeVisitor( document );

        // TODO: remove the need for this when the serializer can calculate last nodes from visitor calls only
        visitor = new BuildingDependencyNodeVisitor( visitor );

        CollectingDependencyNodeVisitor collectingVisitor = new CollectingDependencyNodeVisitor();
        DependencyNodeVisitor firstPassVisitor =
            new FilteringDependencyNodeVisitor( collectingVisitor, StateDependencyNodeFilter.INCLUDED );
        rootNode.accept( firstPassVisitor );

        DependencyNodeFilter secondPassFilter = new AncestorOrSelfDependencyNodeFilter( collectingVisitor.getNodes() );
        visitor = new FilteringDependencyNodeVisitor( visitor, secondPassFilter );

        rootNode.accept( visitor );

        FileWriter writer = null;
        try
        {
            Artifact artifact =
                artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(),
                                                       project.getVersion() );

            String p = layout.pathOf( artifact );
            if ( !p.equals( path ) )
            {
                throw new ConsumerException( "Bad path: " + p + "; should be: " + path );
            }

            File generatedFile = new File( generatedRepositoryLocation, p + ".xml" );
            generatedFile.getParentFile().mkdirs();
            writer = new FileWriter( generatedFile );
            OutputFormat format = OutputFormat.createPrettyPrint();
            XMLWriter w = new XMLWriter( writer, format );
            w.write( document );
        }
        catch ( IOException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        finally
        {
            IOUtils.closeQuietly( writer );
        }
View Full Code Here

        {
            context = TaskCreator.createContext( repository );
        }
        catch ( IOException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        catch ( UnsupportedExistingLuceneIndexException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
View Full Code Here

            log.debug( "Queueing indexing task + '" + task + "' to add or update the artifact in the index." );
            scheduler.queueIndexingTask( task );
        }
        catch ( TaskQueueException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
View Full Code Here

        {
            repoContent = repoFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );
        }
        catch ( RepositoryException e )
        {
            throw new ConsumerException( "Can't run index cleanup consumer: " + e.getMessage() );
        }

        ManagedRepositoryConfiguration repository = repoContent.getRepository();

        IndexingContext context = null;
        try
        {
            File artifactFile = new File( repoContent.getRepoRoot(), repoContent.toPath( artifact ) );

            if ( !artifactFile.exists() )
            {
                context = TaskCreator.createContext( repository );

                ArtifactIndexingTask task =
                    TaskCreator.createIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.DELETE,
                                                    context );

                log.debug( "Queueing indexing task '" + task + "' to remove the artifact from the index." );
                scheduler.queueIndexingTask( task );

                // note we finish immediately here since it isn't done repo-by-repo. It might be nice to ensure that is
                // the case for optimisation though
                task =
                    TaskCreator.createIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.FINISH,
                                                    context );
                log.debug( "Queueing indexing task + '" + task + "' to finish indexing." );
                scheduler.queueIndexingTask( task );
            }

        }
        catch ( TaskQueueException e )
        {
            throw new ConsumerException( e.getMessage() );
        }
        catch ( IOException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        catch ( UnsupportedExistingLuceneIndexException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
View Full Code Here

                                                                        localRepository.toURL().toExternalForm(),
                                                                        layout, null, null );
            }
            catch ( MalformedURLException e )
            {
                throw new ConsumerException( e.getMessage(), e );
            }
        }
    }
View Full Code Here

            // manually flush out the cache for memory concerns and more accurate building
            flushProjectCache( projectBuilder );
        }
        catch ( ProjectBuildingException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }

        DependencyNode rootNode;
        try
        {
            // TODO: do this for different values of new ScopeArtifactFilter( scope )
            ArtifactFilter artifactFilter = null;

            rootNode =
                dependencyTreeBuilder.buildDependencyTree( project, localArtifactRepository, artifactFactory,
                                                           artifactMetadataSource, artifactFilter, artifactCollector );
        }
        catch ( DependencyTreeBuilderException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }

        Document document = DocumentHelper.createDocument();
        DependencyNodeVisitor visitor = new XmlSerializingDependencyNodeVisitor( document );

        // TODO: remove the need for this when the serializer can calculate last nodes from visitor calls only
        visitor = new BuildingDependencyNodeVisitor( visitor );

        CollectingDependencyNodeVisitor collectingVisitor = new CollectingDependencyNodeVisitor();
        DependencyNodeVisitor firstPassVisitor =
            new FilteringDependencyNodeVisitor( collectingVisitor, StateDependencyNodeFilter.INCLUDED );
        rootNode.accept( firstPassVisitor );

        DependencyNodeFilter secondPassFilter = new AncestorOrSelfDependencyNodeFilter( collectingVisitor.getNodes() );
        visitor = new FilteringDependencyNodeVisitor( visitor, secondPassFilter );

        rootNode.accept( visitor );

        FileWriter writer = null;
        try
        {
            Artifact artifact =
                artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(),
                                                       project.getVersion() );

            String p = layout.pathOf( artifact );
            if ( !p.equals( path ) )
            {
                throw new ConsumerException( "Bad path: " + p + "; should be: " + path );
            }

            File generatedFile = new File( generatedRepositoryLocation, p + ".xml" );
            generatedFile.getParentFile().mkdirs();
            writer = new FileWriter( generatedFile );
            OutputFormat format = OutputFormat.createPrettyPrint();
            XMLWriter w = new XMLWriter( writer, format );
            w.write( document );
        }
        catch ( IOException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        finally
        {
            IOUtils.closeQuietly( writer );
        }
View Full Code Here

            this.repositoryDir = new File( repository.getRepoRoot() );
            this.scanStartTimestamp = System.currentTimeMillis();
        }
        catch ( RepositoryNotFoundException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
        catch ( RepositoryException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.consumers.ConsumerException

Copyright © 2018 www.massapicom. 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.