Package org.jboss.forge.project.facets

Examples of org.jboss.forge.project.facets.DependencyFacet.resolveAvailableVersions()


  
   private Dependency promptVersion(Dependency dependency)
   {
      DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class);
      Dependency result = dependency;
      List<Dependency> versions = dependencyFacet.resolveAvailableVersions(DependencyQueryBuilder.create(dependency)
               .setFilter(new NonSnapshotDependencyFilter()));
      if (versions.size() > 0)
      {
         Dependency deflt = versions.get(versions.size() - 1);
         result = prompt.promptChoiceTyped("Use which version of '" + dependency.getArtifactId()
View Full Code Here


   @Override
   public boolean install()
   {
      DependencyFacet deps = project.getFacet(DependencyFacet.class);

      List<Dependency> versions = deps.resolveAvailableVersions("org.jboss.forge:forge-shell-api:[,]");
      Dependency version = shell.promptChoiceTyped("Install which version of the Forge API?", versions);
      deps.setProperty("forge.api.version", version.getVersion());
      DependencyBuilder dep = DependencyBuilder.create("org.jboss.forge:forge-shell-api:${forge.api.version}");
      deps.addDependency(dep);
      return true;
View Full Code Here

   @Override
   public boolean install()
   {
      DependencyFacet deps = project.getFacet(DependencyFacet.class);

      List<Dependency> versions = deps.resolveAvailableVersions("org.jboss.forge:forge-shell-api:[,]");
      Dependency version = shell.promptChoiceTyped("Install which version of the Forge API?", versions);
      deps.setProperty("forge.api.version", version.getVersion());
      DependencyBuilder apiDep = DependencyBuilder.create("org.jboss.forge:forge-shell-api:${forge.api.version}")
               .setScopeType(ScopeType.PROVIDED);
      DependencyBuilder testDep = DependencyBuilder.create("org.jboss.forge:forge-test-harness:${forge.api.version}")
View Full Code Here

         if (!shell.promptBoolean(String.format("Dependency is managed [%s:%s:%s], reference the managed dependency?",
                  existingDep.getGroupId(), existingDep.getArtifactId(), existingDep.getVersion()), true))
         {
            if (Strings.isNullOrEmpty(gavCopy.getVersion()))
            {
               gavCopy = shell.promptChoiceTyped("Add which version?", deps.resolveAvailableVersions(gavCopy));
            }
         }
      }
      this.dependencyInstaller.install(project, gavCopy);
   }
View Full Code Here

      DependencyFacet deps = project.getFacet(DependencyFacet.class);
      if ((gav.getVersion() == null) || gav.getVersion().trim().isEmpty())
      {
         gav = DependencyBuilder.create(gav).setVersion("[0,)");
      }
      List<Dependency> versions = deps.resolveAvailableVersions(gav);

      for (Dependency dep : versions)
      {
         out.println(DependencyBuilder.toString(dep));
      }
View Full Code Here

               || shell.promptBoolean(
                        "Managed dependency already exists [" + gav.getGroupId() + ":" + gav.getArtifactId()
                                 + "], continue?", true))
      {
         DependencyBuilder search = DependencyBuilder.create(gav).setVersion("[0,)");
         List<Dependency> availableVersions = manDeps.resolveAvailableVersions(search);

         if (availableVersions.isEmpty())
         {
            throw new RuntimeException("No available versions resolved for managed dependency [" + gav + "]");
         }
View Full Code Here

      DependencyFacet manDeps = project.getFacet(DependencyFacet.class);
      if ((gav.getVersion() == null) || gav.getVersion().trim().isEmpty())
      {
         gav = DependencyBuilder.create(gav).setVersion("[0,)");
      }
      List<Dependency> versions = manDeps.resolveAvailableVersions(gav);

      for (Dependency manDep : versions)
      {
         out.println(DependencyBuilder.toString(manDep));
      }
View Full Code Here

   private org.jboss.forge.project.dependencies.Dependency resolveVersion(DependencyBuilder containerDependency)
   {
      DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class);

      List<org.jboss.forge.project.dependencies.Dependency> versions = dependencyFacet.resolveAvailableVersions(containerDependency);
      return shell.promptChoiceTyped("What version of " + containerDependency.getArtifactId() + " do you want to use?", versions, DependencyUtil.getLatestNonSnapshotVersion(versions));
   }
}
View Full Code Here

   }

   protected void promptToSelectAvailableVersions(DependencyBuilder frameworkDependency)
   {
      final DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class);
      final List<Dependency> dependencies = dependencyFacet.resolveAvailableVersions(frameworkDependency);

      Dependency dependency = getPrompt().promptChoiceTyped("Which version of [" + getFrameworkName() + "] would you like to install?",
            dependencies,
            DependencyUtil.getLatestNonSnapshotVersion(dependencies));
View Full Code Here

      {
         throw new RuntimeException("Container profile with id " + container.getId() + " or "
               + container.getProfileId() + " not found");
      }

      List<org.jboss.forge.project.dependencies.Dependency> asDependencies = dependencyFacet
            .resolveAvailableVersions(DependencyBuilder.create()
                  .setGroupId(container.getDownload().getGroupId())
                  .setArtifactId(container.getDownload().getArtifactId()));
      org.jboss.forge.project.dependencies.Dependency asVersion = shell.promptChoiceTyped(
            "Which version of the container do you want to install?", asDependencies,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.