Package org.jboss.forge.maven

Examples of org.jboss.forge.maven.MavenPluginFacet


         for (DirectoryResource folder : this.getWebRootDirectories())
         {
            folder.mkdirs();
         }

         MavenPluginFacet plugins = project.getFacet(MavenPluginFacet.class);
         DependencyBuilder mvnWarPluginDep = DependencyBuilder.create("org.apache.maven.plugins:maven-war-plugin")
                  .setVersion("2.1.1");

         MavenPlugin plugin;
         if (!plugins.hasPlugin(mvnWarPluginDep))
         {
            plugin = MavenPluginBuilder.create().setDependency(mvnWarPluginDep);
            plugins.addPlugin(plugin);
         }
         else
         {
            plugin = plugins.getPlugin(mvnWarPluginDep);
         }

         if (plugin.getConfig() == null)
         {

         }

         if (!plugin.getConfig().hasConfigurationElement("failOnMissingWebXml"))
         {
            plugin.getConfig().addConfigurationElement(
                     ConfigurationElementBuilder.create().setName("failOnMissingWebXml").setText("false"));
         }
         else
         {
            ConfigurationElementBuilder configElement = ConfigurationElementBuilder.createFromExisting(plugin
                     .getConfig().getConfigurationElement("failOnMissingWebXml"));
            plugin.getConfig().removeConfigurationElement("failOnMissingWebXml");
            plugin.getConfig().addConfigurationElement(configElement);
         }

         plugins.removePlugin(mvnWarPluginDep);
         plugins.addPlugin(plugin);
      }
      return true;
   }
View Full Code Here


   }

   @Command("list-plugin-repositories")
   public void pluginRepoList(final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);
      List<DependencyRepository> repos = deps.getPluginRepositories();

      for (DependencyRepository repo : repos)
      {
         out.print(repo.getId() + "->");
         out.println(ShellColor.BLUE, repo.getUrl());
View Full Code Here

   @Command("add-known-plugin-repository")
   public void pluginRepoAdd(
            @Option(description = "type...", required = true) final MavenPluginFacet.KnownRepository repo,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      if (deps.hasPluginRepository(repo))
      {
         out.println("Plugin repository exists [" + repo.name() + "->" + repo.getUrl() + "]");
      }
      else
      {
         deps.addPluginRepository(repo);
         out.println("Added plugin repository [" + repo.name() + "->" + repo.getUrl() + "]");
      }
   }
View Full Code Here

   public void pluginRepoAdd(
            @Option(description = "repository name...", required = true) final String name,
            @Option(description = "repository URL...", required = true) final String url,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      if (deps.hasPluginRepository(url))
      {
         out.println("Plugin repository exists [" + url + "]");
      }
      else
      {
         deps.addPluginRepository(name, url);
         out.println("Added plugin repository [" + name + "->" + url + "]");
      }
   }
View Full Code Here

   public void pluginRepoRemove(
            @Option(required = true, description = "repo url...",
                     completer = PluginRepositoryCompleter.class) final String url,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      DependencyRepository rep;
      if ((rep = deps.removePluginRepository(url)) != null)
      {
         out.println("Removed plugin repository [" + rep.getId() + "->" + rep.getUrl() + "]");
      }
      else
      {
View Full Code Here

   }

   @Command("list-plugin-repositories")
   public void pluginRepoList(final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);
      List<DependencyRepository> repos = deps.getPluginRepositories();

      for (DependencyRepository repo : repos)
      {
         out.print(repo.getId() + "->");
         out.println(ShellColor.BLUE, repo.getUrl());
View Full Code Here

   @Command("add-known-plugin-repository")
   public void pluginRepoAdd(
            @Option(description = "type...", required = true) final MavenPluginFacet.KnownRepository repo,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      if (deps.hasPluginRepository(repo))
      {
         out.println("Plugin repository exists [" + repo.name() + "->" + repo.getUrl() + "]");
      }
      else
      {
         deps.addPluginRepository(repo);
         out.println("Added plugin repository [" + repo.name() + "->" + repo.getUrl() + "]");
      }
   }
View Full Code Here

   public void pluginRepoAdd(
            @Option(description = "repository name...", required = true) final String name,
            @Option(description = "repository URL...", required = true) final String url,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      if (deps.hasPluginRepository(url))
      {
         out.println("Plugin repository exists [" + url + "]");
      }
      else
      {
         deps.addPluginRepository(name, url);
         out.println("Added plugin repository [" + name + "->" + url + "]");
      }
   }
View Full Code Here

   public void pluginRepoRemove(
            @Option(required = true, description = "repo url...",
                     completer = PluginRepositoryCompleter.class) final String url,
            final PipeOut out)
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);

      DependencyRepository rep;
      if ((rep = deps.removePluginRepository(url)) != null)
      {
         out.println("Removed plugin repository [" + rep.getId() + "->" + rep.getUrl() + "]");
      }
      else
      {
View Full Code Here

   private Project project;

   @Override
   public List<Object> getCompletionTokens()
   {
      MavenPluginFacet deps = project.getFacet(MavenPluginFacet.class);
      List<DependencyRepository> repositories = deps.getPluginRepositories();

      List<Object> result = new ArrayList<Object>();
      for (DependencyRepository dependencyRepository : repositories)
      {
         result.add(dependencyRepository.getUrl());
View Full Code Here

TOP

Related Classes of org.jboss.forge.maven.MavenPluginFacet

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.