Package org.sonatype.aether

Examples of org.sonatype.aether.RepositorySystemSession


        File resolved = resolve(session, artifact);
        return IO.read(resolved);
    }

    public VersionRangeResult resolveVersions(String groupId, String artifactId, String classifier, String extension, String version) {
        final RepositorySystemSession session = newSession();
        Artifact artifact = new DefaultArtifact(groupId, artifactId, classifier, extension, version);
        if (artifact.getVersion().equals("LATEST")) {
            artifact = artifact.setVersion(LATEST_VERSION_RANGE);
        }
        final VersionRangeRequest request = new VersionRangeRequest(artifact, m_remoteRepos, null);
View Full Code Here


        Set<Artifact> artifacts = request.getArtifactDependencies();
        Map managedVersions = request.getManagedVersionMap();
        List<ResolutionListener> listeners = request.getListeners();
        ArtifactFilter collectionFilter = request.getCollectionFilter();                      
        ArtifactFilter resolutionFilter = request.getResolutionFilter();
        RepositorySystemSession session = getSession( request.getLocalRepository() );
       
        //TODO: hack because metadata isn't generated in m2e correctly and i want to run the maven i have in the workspace
        if ( source == null )
        {
            try
View Full Code Here

        throws DependencyResolutionException
    {
        DefaultDependencyResolutionResult result = new DefaultDependencyResolutionResult();

        MavenProject project = request.getMavenProject();
        RepositorySystemSession session = request.getRepositorySession();
        DependencyFilter filter = request.getResolutionFilter();

        ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry();

        CollectRequest collect = new CollectRequest();
        collect.setRequestContext( "project" );
        collect.setRepositories( project.getRemoteProjectRepositories() );
View Full Code Here

    {
        super.setUp();
        artifactFactory = lookup( ArtifactFactory.class);       
        artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );

        RepositorySystemSession repoSession = initRepoSession();
        MavenSession session =
            new MavenSession( getContainer(), repoSession, new DefaultMavenExecutionRequest(),
                              new DefaultMavenExecutionResult() );

        LegacySupport legacySupport = lookup(LegacySupport.class);
View Full Code Here

            throw new IllegalArgumentException(artifact.getVersion() + " is a version range. A specific version is needed");
        } catch (InvalidVersionSpecificationException expected) {

        }

        RepositorySystemSession session = newRepositorySystemSession();
        RemoteRepository central = newCentralRepository();
        //TODO add more remote repositories - especially the JBoss one

        ArtifactRequest artifactRequest = new ArtifactRequest();
        artifactRequest.setArtifact(artifact);
View Full Code Here

    private void resolve( ResolveRequest resolveRequest )
    {

        RepositorySystem system = newRepositorySystem();

        RepositorySystemSession session = newRepositorySystemSession( system, resolveRequest.localRepoDir );

        org.sonatype.aether.artifact.Artifact artifact = new DefaultArtifact(
            resolveRequest.groupId + ":" + resolveRequest.artifactId + ":" + resolveRequest.version );

        CollectRequest collectRequest = new CollectRequest();
View Full Code Here

                          DependencyVisitor dependencyVisitor )
    {

        RepositorySystem system = newRepositorySystem();

        RepositorySystemSession session = newRepositorySystemSession( system, localRepoDir );

        org.sonatype.aether.artifact.Artifact artifact =
            new DefaultArtifact( groupId + ":" + artifactId + ":" + version );

        CollectRequest collectRequest = new CollectRequest();
View Full Code Here

    private List<Artifact> getServerDependencies(final String serverType,
                                                 final ExpressionEvaluator expressionEvaluator)
            throws ComponentConfigurationException {
        try {
            final MavenProject project = (MavenProject) expressionEvaluator.evaluate("${project}");
            final RepositorySystemSession session = (RepositorySystemSession) expressionEvaluator.evaluate("${repositorySystemSession}");
            if (session != null) {
                try {
                    final File repo = session.getLocalRepository().getBasedir();
                    return new Aether(project, repo).resolve(
                            getServerArtifact(serverType),
                            JavaScopes.RUNTIME);
                } catch (final DependencyResolutionException e) {
                    final String message = new StringBuilder("Could not resolve dependencies for server type: ")
View Full Code Here

    {
        Artifact pluginArtifact = toArtifact( plugin, session );

        try
        {
            RepositorySystemSession pluginSession = new FilterRepositorySystemSession( session )
            {
                @Override
                public boolean isIgnoreMissingArtifactDescriptor()
                {
                    return false;
View Full Code Here

            throw new IllegalArgumentException(artifact.getVersion() + " is a version range. A specific version is needed");
        } catch (InvalidVersionSpecificationException expected) {

        }

        RepositorySystemSession session = newRepositorySystemSession();
        RemoteRepository central = newCentralRepository();
        //TODO add more remote repositories - especially the JBoss one

        ArtifactRequest artifactRequest = new ArtifactRequest();
        artifactRequest.setArtifact(artifact);
View Full Code Here

TOP

Related Classes of org.sonatype.aether.RepositorySystemSession

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.