Package org.apache.maven.artifact.repository

Examples of org.apache.maven.artifact.repository.RepositoryRequest


    @Requirement
    private LegacySupport legacySupport;

    private RepositoryRequest getRepositoryRequest( MavenSession session, MavenProject project )
    {
        RepositoryRequest request = new DefaultRepositoryRequest();

        request.setCache( session.getRepositoryCache() );
        request.setLocalRepository( session.getLocalRepository() );
        if ( project != null )
        {
            request.setRemoteRepositories( project.getPluginArtifactRepositories() );
        }
        request.setOffline( session.isOffline() );
        request.setForceUpdate( session.getRequest().isUpdateSnapshots() );
        request.setTransferListener( session.getRequest().getTransferListener() );

        return request;
    }
View Full Code Here


        MavenSession session = legacySupport.getSession();

        PluginDescriptor pluginDescriptor;
        try
        {
            RepositoryRequest repositoryRequest = getRepositoryRequest( session, session.getCurrentProject() );

            pluginDescriptor = pluginManager.getPluginDescriptor( plugin, repositoryRequest );

            pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
        }
View Full Code Here

        MavenSession session = legacySupport.getSession();

        PluginDescriptor pluginDescriptor;
        try
        {
            RepositoryRequest repositoryRequest = getRepositoryRequest( session, session.getCurrentProject() );

            pluginDescriptor = pluginManager.getPluginDescriptor( plugin, repositoryRequest );

            pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
        }
View Full Code Here

                                          ArtifactRepository localRepository )
        throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
        InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
        PluginVersionNotFoundException
    {
        RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
        repositoryRequest.setLocalRepository( localRepository );
        repositoryRequest.setRemoteRepositories( project.getPluginArtifactRepositories() );
        repositoryRequest.setOffline( settings.isOffline() );

        if ( plugin.getVersion() == null )
        {
            PluginVersionRequest versionRequest = new DefaultPluginVersionRequest( plugin, repositoryRequest );
            plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() );
        }

        try
        {
            return pluginManager.getPluginDescriptor( plugin, repositoryRequest );
        }
        catch ( PluginResolutionException e )
        {
            throw new PluginNotFoundException( plugin, repositoryRequest.getRemoteRepositories() );
        }
        catch ( PluginDescriptorParsingException e )
        {
            throw new PluginManagerException( plugin, e.getMessage(), e );
        }
View Full Code Here

        MavenSession session = legacySupport.getSession();

        PluginDescriptor pluginDescriptor;
        try
        {
            RepositoryRequest repositoryRequest = DefaultRepositoryRequest.getRepositoryRequest( session, session.getCurrentProject() );

            pluginDescriptor = pluginManager.getPluginDescriptor( plugin, repositoryRequest );

            pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
        }
View Full Code Here

        MavenSession session = legacySupport.getSession();

        PluginDescriptor pluginDescriptor;
        try
        {
            RepositoryRequest repositoryRequest = DefaultRepositoryRequest.getRepositoryRequest( session, session.getCurrentProject() );

            pluginDescriptor = pluginManager.getPluginDescriptor( plugin, repositoryRequest );

            pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
        }
View Full Code Here

                                          ArtifactRepository localRepository )
        throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
        InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
        PluginVersionNotFoundException
    {
        RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
        repositoryRequest.setLocalRepository( localRepository );
        repositoryRequest.setRemoteRepositories( project.getPluginArtifactRepositories() );
        repositoryRequest.setOffline( settings.isOffline() );

        if ( plugin.getVersion() == null )
        {
            PluginVersionRequest versionRequest = new DefaultPluginVersionRequest( plugin, repositoryRequest );
            plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() );
        }

        try
        {
            return pluginManager.getPluginDescriptor( plugin, repositoryRequest );
        }
        catch ( PluginResolutionException e )
        {
            throw new PluginNotFoundException( plugin, repositoryRequest.getRemoteRepositories() );
        }
        catch ( PluginDescriptorParsingException e )
        {
            throw new PluginManagerException( plugin, e.getMessage(), e );
        }
View Full Code Here

            plugin = findPluginForPrefix( prefix, session );
        }

        injectPluginDeclarationFromProject( plugin, project );

        RepositoryRequest repositoryRequest = DefaultRepositoryRequest.getRepositoryRequest( session, project );

        // If there is no version to be found then we need to look in the repository metadata for
        // this plugin and see what's specified as the latest release.
        //
        if ( plugin.getVersion() == null )
View Full Code Here

        return "src/test/projects/plugin-manager";
    }

    private RepositoryRequest getRepositoryRequest( MavenSession session )
    {
        RepositoryRequest request = new DefaultRepositoryRequest();

        request.setLocalRepository( session.getLocalRepository() );
        request.setRemoteRepositories( session.getCurrentProject().getPluginArtifactRepositories() );

        return request;
    }
View Full Code Here

       
        MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) );
        MavenProject project = session.getCurrentProject();
        Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" );               
       
        RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
        repositoryRequest.setLocalRepository( getLocalRepository() );
        repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() );

        PluginDescriptor pluginDescriptor = pluginManager.loadPlugin( plugin, getRepositoryRequest( session ) );
        pluginManager.getPluginRealm( session, pluginDescriptor );
        List<Artifact> artifacts = pluginDescriptor.getArtifacts();
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.RepositoryRequest

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.