Package org.apache.maven.artifact.resolver

Examples of org.apache.maven.artifact.resolver.ArtifactResolutionRequest


                                             ArtifactMetadataSource source,
                                             ArtifactFilter filter,
                                             List<ResolutionListener> listeners,
                                             List<ConflictResolver> conflictResolvers )
    {
        ArtifactResolutionRequest request = new ArtifactResolutionRequest();
        request.setLocalRepository( localRepository );
        request.setRemoteRepositories( remoteRepositories );
        return collect( artifacts, originatingArtifact, managedVersions, request, source, filter, listeners,
                        conflictResolvers );
    }
View Full Code Here


                            throw new ArtifactResolutionException( "Unable to get dependency information: "
                                + e.getMessage(), artifact, childRemoteRepositories, e );
                        }

                        ArtifactResolutionRequest subRequest = new ArtifactResolutionRequest( metadataRequest );
                        subRequest.setServers( request.getServers() );
                        subRequest.setMirrors( request.getMirrors() );
                        subRequest.setProxies( request.getProxies() );
                        recurse( result, child, resolvedArtifacts, managedVersions, subRequest, source, filter,
                                 listeners, conflictResolvers );
                    }
                }
                catch ( OverConstrainedVersionException e )
View Full Code Here

            if ( configuration.isResolveDependencies() )
            {
                Artifact artifact = new ProjectArtifact( project );

                ArtifactResolutionRequest artifactRequest = new ArtifactResolutionRequest()
                    .setArtifact( artifact )
                    .setResolveRoot( false )
                    .setResolveTransitively( true )
                    .setCache( configuration.getRepositoryCache() )
                    .setLocalRepository( configuration.getLocalRepository() )
                    .setRemoteRepositories( project.getRemoteArtifactRepositories() )
                    .setOffline( configuration.isOffline() )
                    .setForceUpdate( configuration.isForceUpdate() )
                    .setManagedVersionMap( project.getManagedVersionMap() );
                artifactRequest.setTransferListener( configuration.getTransferListener() );

                artifactResult = repositorySystem.resolve( artifactRequest );

                project.setArtifacts( artifactResult.getArtifacts() );
            }
View Full Code Here

        if ( !artifact.getType().equals( "pom" ) )
        {
            artifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
        }

        ArtifactResolutionRequest request = new ArtifactResolutionRequest()
            .setArtifact( artifact )
            .setCache( configuration.getRepositoryCache() )
            .setLocalRepository( configuration.getLocalRepository() )
            .setRemoteRepositories( configuration.getRemoteRepositories() )
            .setOffline( configuration.isOffline() )
            .setForceUpdate( configuration.isForceUpdate() );
        request.setTransferListener( configuration.getTransferListener() );

        ArtifactResolutionResult result = repositorySystem.resolve( request );

        try
        {
View Full Code Here

        ArtifactFilter collectionFilter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM );

        ArtifactFilter resolutionFilter = artifactFilterManager.getCoreArtifactFilter();

        ArtifactResolutionRequest request = new ArtifactResolutionRequest( repositoryRequest );
        request.setArtifact( extensionArtifact );
        request.setArtifactDependencies( overrideArtifacts );
        request.setCollectionFilter( collectionFilter );
        request.setResolutionFilter( resolutionFilter );
        request.setResolveRoot( true );
        request.setResolveTransitively( true );

        ArtifactResolutionResult result = repositorySystem.resolve( request );

        try
        {
View Full Code Here

    private Artifact resolvePluginArtifact( Plugin plugin, RepositoryRequest repositoryRequest )
        throws PluginResolutionException
    {
        Artifact pluginArtifact = repositorySystem.createPluginArtifact( plugin );

        ArtifactResolutionRequest request = new ArtifactResolutionRequest( repositoryRequest );
        request.setArtifact( pluginArtifact );
        request.setResolveTransitively( false );

        ArtifactResolutionResult result = repositorySystem.resolve( request );

        try
        {
View Full Code Here

        if ( extensionArtifactFilter != null )
        {
            resolutionFilter = new AndArtifactFilter( Arrays.asList( resolutionFilter, extensionArtifactFilter ) );
        }

        ArtifactResolutionRequest request = new ArtifactResolutionRequest( repositoryRequest );
        request.setArtifact( pluginArtifact );
        request.setArtifactDependencies( overrideArtifacts );
        request.setCollectionFilter( collectionFilter );
        request.setResolutionFilter( resolutionFilter );
        request.setResolveRoot( true );
        request.setResolveTransitively( true );

        ArtifactResolutionResult result = repositorySystem.resolve( request );
        try
        {
            resolutionErrorHandler.throwErrors( request, result );
View Full Code Here

        if ( pomFile == null )
        {
            Artifact artifactParent = repositorySystem.createProjectArtifact( groupId, artifactId, version );

            ArtifactResolutionRequest request = new ArtifactResolutionRequest();
            request.setArtifact( artifactParent );
            request.setRemoteRepositories( remoteRepositories );
            request.setLocalRepository( projectBuildingRequest.getLocalRepository() );
            request.setOffline( projectBuildingRequest.isOffline() );
            request.setCache( projectBuildingRequest.getRepositoryCache() );
            request.setTransferListener( projectBuildingRequest.getTransferListener() );

            ArtifactResolutionResult result = repositorySystem.resolve( request );

            try
            {
View Full Code Here

        Artifact plexusUtils =
            repositorySystem.createArtifact( "org.codehaus.plexus", "plexus-utils", "1.1", Artifact.SCOPE_RUNTIME,
                                             "jar" );

        ArtifactResolutionRequest request = new ArtifactResolutionRequest( repositoryRequest );
        request.setArtifact( plexusUtils );
        request.setResolveRoot( true );
        request.setResolveTransitively( false );

        ArtifactResolutionResult result = repositorySystem.resolve( request );
        try
        {
            resolutionErrorHandler.throwErrors( request, result );
View Full Code Here

        for (MavenProject project : session.getProjects()) {
            repositories.addAll(project.getPluginArtifactRepositories());
        }
        repositories = repositorySystem.getEffectiveRepositories(repositories);

        ArtifactResolutionRequest request = new ArtifactResolutionRequest();
        request.setArtifact(artifact);
        request.setResolveRoot(true).setResolveTransitively(false);
        request.setLocalRepository(session.getLocalRepository());
        request.setRemoteRepositories(repositories);
        request.setCache(session.getRepositoryCache());
        request.setOffline(session.isOffline());
        request.setForceUpdate(session.getRequest().isUpdateSnapshots());

        ArtifactResolutionResult result = repositorySystem.resolve(request);

        try {
            resolutionErrorHandler.throwErrors(request, result);
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.resolver.ArtifactResolutionRequest

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.