Package org.jboss.forge.addon.projects.facets

Examples of org.jboss.forge.addon.projects.facets.DependencyFacet


   abstract protected Map<Dependency, List<Dependency>> getRequiredDependencyOptions();

   @Override
   public boolean install()
   {
      DependencyFacet deps = origin.getFacet(DependencyFacet.class);
      for (Entry<Dependency, List<Dependency>> group : getRequiredDependencyOptions().entrySet())
      {
         boolean satisfied = false;
         for (Dependency dependency : group.getValue())
         {
            if (deps.hasEffectiveDependency(dependency))
            {
               satisfied = true;
               break;
            }
         }
View Full Code Here


      return dependencyRequirementsMet();
   }

   protected boolean dependencyRequirementsMet()
   {
      DependencyFacet deps = origin.getFacet(DependencyFacet.class);
      for (Entry<Dependency, List<Dependency>> group : getRequiredDependencyOptions().entrySet())
      {
         boolean satisfied = false;
         for (Dependency dependency : group.getValue())
         {
            if (deps.hasEffectiveDependency(dependency))
            {
               satisfied = true;
               break;
            }
         }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int numberOfGavsFound = 0;
         int numberOfGavs = 0;
         for (Dependency gav : arguments.getValue())
         {
            numberOfGavs++;
            DependencyBuilder dep = DependencyBuilder.create(gav);
            if(effective.getValue()) {
               if(deps.hasEffectiveManagedDependency(gav)) {
                  numberOfGavsFound++;
               }
            } else {
               if(deps.hasDirectManagedDependency(dep)) {
                  numberOfGavsFound++;
               }
            }
         }
         if(numberOfGavs == numberOfGavsFound) {
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int numberOfGavsFound = 0;
         int numberOfGavs = 0;
         for (Dependency gav : arguments.getValue())
         {
            numberOfGavs++;
            DependencyBuilder dep = DependencyBuilder.create(gav);
            if(effective.getValue()) {
               if(deps.hasEffectiveDependency(gav)) {
                  numberOfGavsFound++;
               }
            } else {
               if(deps.hasDirectDependency(dep)) {
                  numberOfGavsFound++;
               }
            }
         }
         if(numberOfGavs == numberOfGavsFound) {
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int count = 0;
         for (Dependency gav : arguments.getValue())
         {
            Dependency existingDep = deps.getEffectiveManagedDependency(DependencyBuilder.create(gav).setVersion(null));
            if (existingDep != null)
            {
               if (context.getPrompt().promptBoolean(String.format(
                        "Dependency [%s:%s] is currently managed. "
                                 + "Reference the existing managed dependency [%s:%s:%s]?",
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int count = 0;
         for (Dependency gav : arguments.getValue())
         {
            deps.removeManagedDependency(gav);
            if (removeUnmanaged.getValue() && !deps.hasEffectiveManagedDependency(gav))
            {
               deps.removeDependency(gav);
            }
            count++;
         }

         return Results.success("Removed [" + count + "] dependenc" + (count == 1 ? "y" : "ies") + ".");
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int count = 0;
         for (Dependency gav : arguments.getValue())
         {
            Dependency existingDep = deps.getEffectiveManagedDependency(DependencyBuilder.create(gav).setVersion(null));
            if (existingDep != null)
            {
               if (context.getPrompt().promptBoolean(String.format(
                        "Dependency [%s:%s] is currently managed. "
                                 + "Reference the existing managed dependency [%s:%s:%s]?",
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int count = 0;
         for (Dependency gav : arguments.getValue())
         {
            deps.removeDependency(gav);
            if(removeManaged.getValue())
            {
               deps.removeManagedDependency(gav);
            }
            count++;
         }

         return Results.success("Removed [" + count + "] dependenc" + (count == 1 ? "y" : "ies") + ".");
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      final Result result;
      Project project = getSelectedProject(context.getUIContext());
      DependencyFacet deps = project.getFacet(DependencyFacet.class);

      String name = named.getValue();
      String urlValue = url.getValue();
      if (deps.hasRepository(urlValue))
      {
         result = Results.fail("Repository exists [" + url + "]");
      }
      else
      {
         deps.addRepository(name, urlValue);
         result = Results.success("Added repository [" + name + "->" + urlValue + "]");
      }
      return result;
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context)
   {
      Project project = getSelectedProject(context.getUIContext());
      final DependencyFacet deps = project.getFacet(DependencyFacet.class);

      if (arguments.hasValue())
      {
         int numberOfGavsFound = 0;
         int numberOfGavs = 0;
         for (Dependency gav : arguments.getValue())
         {
            numberOfGavs++;
            DependencyBuilder dep = DependencyBuilder.create(gav);
            if(effective.getValue()) {
               if(deps.hasEffectiveDependency(gav)) {
                  numberOfGavsFound++;
               }
            } else {
               if(deps.hasDirectDependency(dep)) {
                  numberOfGavsFound++;
               }
            }
         }
         if(numberOfGavs == numberOfGavsFound) {
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.projects.facets.DependencyFacet

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.