Package org.jboss.forge.maven

Examples of org.jboss.forge.maven.MavenPluginFacet


   private void modifyCompilerPlugin()
   {
      Dependency compilerDependency = DependencyBuilder.create()
               .setGroupId("org.apache.maven.plugins")
               .setArtifactId("maven-compiler-plugin");
      MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
      MavenPlugin compiler = pluginFacet.getPlugin(compilerDependency);
      Configuration config = compiler.getConfig();
      if (!config.hasConfigurationElement("proc"))
      {
         ConfigurationElement proc = ConfigurationBuilder.create().createConfigurationElement("proc").setText("none");
         config.addConfigurationElement(proc);
      }
      pluginFacet.updatePlugin(compiler);
   }
View Full Code Here


   }

   private boolean processorConfigured(MetaModelProvider provider)
   {
      DependencyBuilder dependency = createProcessorDependency().setVersion(null);
      MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
      if (pluginFacet.hasPlugin(dependency))
      {
         MavenPlugin plugin = pluginFacet.getPlugin(dependency);
         if (plugin.listExecutions().size() > 0)
         {
            Configuration config = plugin.listExecutions().get(0).getConfig();
            if (config.hasConfigurationElement("processors"))
            {
View Full Code Here

   private void addPluginRepository(MetaModelProvider provider)
   {
      Repository repository = provider.getAptPluginRepository();
      if (repository != null)
      {
         MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
         pluginFacet.addPluginRepository(repository.getName(), repository.getUrl());
      }
   }
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

   @Inject
   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

   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

   }

   @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

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.