Package org.sonatype.aether.resolution

Examples of org.sonatype.aether.resolution.VersionRangeResult


         session.setUpdatePolicy(RepositoryPolicy.UPDATE_POLICY_ALWAYS);

         Artifact artifact = dependencyToMavenArtifact(dep);
         VersionRangeRequest rangeRequest = new VersionRangeRequest(artifact, repositories, null);

         VersionRangeResult rangeResult = maven.resolveVersionRange(session, rangeRequest);
         return rangeResult;
      }
      catch (Exception e)
      {
         throw new ProjectModelException("Failed to look up versions for [" + dep + "]", e);
View Full Code Here


            System.out.println(String.format("Checking [%s] for newer version...", gav));
            ArtifactInstallFactory installFactory = artifactInstallFactoryProvider.get();
            if (localrepo != null)
                installFactory.setLocalRepository(localrepo);

            VersionRangeResult rangeResult = installFactory.findVersions(gav);
            Version newestVersion = rangeResult.getHighestVersion();

            VersionNumber currentVersion = new VersionNumber(gav.version);
            VersionNumber availableVersion = new VersionNumber(newestVersion.toString());

            System.out.println();
            if (currentVersion.compareTo(availableVersion) < 0) {
                System.out.println("A newest version [" + newestVersion + "] exists from repository: "
                        + rangeResult.getRepository(newestVersion));

                boolean install = true;
                if (force == null || !force.booleanValue()) {
                    System.out.println();
                    install = Helper.promptMatches("Do you want to install the latest version [" + newestVersion + "]: (y/n) ", "[yY].*");
 
View Full Code Here

            MavenRepositorySystemSession session = setupRepoSession(system);

            session.setIgnoreInvalidArtifactDescriptor(true);
            session.setIgnoreMissingArtifactDescriptor(true);

            VersionRangeResult versions = getVersions(dep, convertToMavenRepos(repositories));

            VERSION: for (Version version : versions.getVersions())
            {
               ArtifactRepository ar = versions.getRepository(version);
               DependencyBuilder currentVersion = DependencyBuilder.create(dep).setVersion(version.toString());
               Artifact artifact = dependencyToMavenArtifact(currentVersion);

               if (ar instanceof LocalRepository)
               {
View Full Code Here

   public List<Dependency> resolveVersions(final Dependency dep, final List<DependencyRepository> repositories)
   {
      List<Dependency> result = new ArrayList<Dependency>();

      List<RemoteRepository> remoteRepos = convertToMavenRepos(repositories);
      VersionRangeResult r = getVersions(dep, remoteRepos);

      for (Version v : r.getVersions())
      {
         result.add(DependencyBuilder.create(dep).setVersion(v.toString()));
      }

      return result;
View Full Code Here

         MavenRepositorySystemSession session = setupRepoSession(maven);

         Artifact artifact = dependencyToMavenArtifact(dep);
         VersionRangeRequest rangeRequest = new VersionRangeRequest(artifact, repositories, null);

         VersionRangeResult rangeResult = maven.resolveVersionRange(session, rangeRequest);
         return rangeResult;
      }
      catch (Exception e)
      {
         throw new ProjectModelException("Failed to look up versions for [" + dep + "]", e);
View Full Code Here

         MavenRepositorySystemSession session = setupRepoSession(system);

         session.setIgnoreInvalidArtifactDescriptor(true);
         session.setIgnoreMissingArtifactDescriptor(true);

         VersionRangeResult versions = getVersions(dep, convertToMavenRepos(repositories));

         VERSION: for (Version version : versions.getVersions())
         {
            ArtifactRepository ar = versions.getRepository(version);
            DependencyBuilder currentVersion = DependencyBuilder.create(dep).setVersion(version.toString());
            Artifact artifact = dependencyToMavenArtifact(currentVersion);

            if (ar instanceof LocalRepository)
            {
View Full Code Here

   public List<Dependency> resolveVersions(final Dependency dep, final List<DependencyRepository> repositories)
   {
      List<Dependency> result = new ArrayList<Dependency>();

      List<RemoteRepository> remoteRepos = convertToMavenRepos(repositories);
      VersionRangeResult r = getVersions(dep, remoteRepos);

      for (Version v : r.getVersions())
      {
         result.add(DependencyBuilder.create(dep).setVersion(v.toString()));
      }

      return result;
View Full Code Here

         MavenRepositorySystemSession session = setupRepoSession(maven);

         Artifact artifact = dependencyToMavenArtifact(dep);
         VersionRangeRequest rangeRequest = new VersionRangeRequest(artifact, repositories, null);

         VersionRangeResult rangeResult = maven.resolveVersionRange(session, rangeRequest);
         return rangeResult;
      }
      catch (Exception e)
      {
         throw new ProjectModelException("Failed to look up versions for [" + dep + "]", e);
View Full Code Here

         MavenRepositorySystemSession session = setupRepoSession(system);

         session.setIgnoreInvalidArtifactDescriptor(true);
         session.setIgnoreMissingArtifactDescriptor(true);

         VersionRangeResult versions = getVersions(dep, convertToMavenRepos(repositories));

         VERSION: for (Version version : versions.getVersions())
         {
            ArtifactRepository ar = versions.getRepository(version);
            DependencyBuilder currentVersion = DependencyBuilder.create(dep).setVersion(version.toString());
            Artifact artifact = dependencyToMavenArtifact(currentVersion);

            if (ar instanceof LocalRepository)
            {
View Full Code Here

   public List<Dependency> resolveVersions(final Dependency dep, final List<DependencyRepository> repositories)
   {
      List<Dependency> result = new ArrayList<Dependency>();

      List<RemoteRepository> remoteRepos = convertToMavenRepos(repositories);
      VersionRangeResult r = getVersions(dep, remoteRepos);

      for (Version v : r.getVersions())
      {
         result.add(DependencyBuilder.create(dep).setVersion(v.toString()));
      }

      return result;
View Full Code Here

TOP

Related Classes of org.sonatype.aether.resolution.VersionRangeResult

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.