Examples of MavenPluginFacet


Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

            .setArtifactId("maven-jar-plugin");

   @Override
   public boolean install()
   {
      MavenPluginFacet pluginFacet = getFaceted().getFacet(MavenPluginFacet.class);
      MavenPluginBuilder plugin = MavenPluginBuilder
               .create()
               .setCoordinate(JAR_PLUGIN_COORDINATE)
               .addExecution(
                        ExecutionBuilder
                                 .create()
                                 .setId("create-forge-addon")
                                 .setPhase("package")
                                 .addGoal("jar")
                                 .setConfig(ConfigurationBuilder.create().addConfigurationElement(
                                          ConfigurationElementBuilder.create().setName("classifier")
                                                   .setText("forge-addon"))));
      pluginFacet.addPlugin(plugin);
      return true;
   }
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddMavenPlugin()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      MavenPluginBuilder plugin = MavenPluginBuilder
               .create()
               .setCoordinate(PLUGIN_COORDINATE);
      // SUT
      facet.addPlugin(plugin);
      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      List<Plugin> plugins = model.getBuild().getPlugins();
      Assert.assertEquals(1, plugins.size());
      assertCoordinateMatch(PLUGIN_COORDINATE, plugins.get(0));
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddMavenPluginProfile()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      MavenPluginBuilder plugin = MavenPluginBuilder
               .create()
               .setCoordinate(PLUGIN_COORDINATE);

      // SUT
      facet.addPlugin(plugin, TEST_PROFILE_ID);

      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertNull(model.getBuild());
      List<Profile> profiles = model.getProfiles();
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddManagedMavenPlugin()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      MavenPluginBuilder plugin = MavenPluginBuilder
               .create()
               .setCoordinate(PLUGIN_COORDINATE);

      // SUT
      facet.addManagedPlugin(plugin);

      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      List<Plugin> plugins = model.getBuild().getPlugins();
      Assert.assertTrue(model.getProfiles().isEmpty());
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddManagedMavenPluginProfile()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      MavenPluginBuilder plugin = MavenPluginBuilder
               .create()
               .setCoordinate(PLUGIN_COORDINATE);
      // SUT
      facet.addManagedPlugin(plugin, TEST_PROFILE_ID);

      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertNull(model.getBuild());
      List<Profile> profiles = model.getProfiles();
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddPluginRepository()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      // SUT
      facet.addPluginRepository(REPOSITORY_ID, REPOSITORY_URL);
      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertEquals(1, model.getPluginRepositories().size());
      Assert.assertTrue(model.getProfiles().isEmpty());
      assertRepositoryMatch(REPOSITORY_ID, REPOSITORY_URL, model.getPluginRepositories().get(0));
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   }

   @Test
   public void testAddPluginRepositoryProfile()
   {
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      // SUT
      facet.addPluginRepository(REPOSITORY_ID, REPOSITORY_URL, TEST_PROFILE_ID);
      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertEquals(0, model.getPluginRepositories().size());
      Assert.assertEquals(1, model.getProfiles().size());
      assertRepositoryMatch(REPOSITORY_ID, REPOSITORY_URL, model.getProfiles().get(0).getPluginRepositories().get(0));
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   public void testInstallFacet() throws Exception
   {
      Project project = projectHelper.createJavaLibraryProject();
      projectHelper.installJPA_2_0(project);
      facetFactory.install(project, PersistenceMetaModelFacet.class);
      MavenPluginFacet facet = project.getFacet(MavenPluginFacet.class);
      MavenPlugin processorPlugin = facet.getPlugin(CoordinateBuilder.create("org.bsc.maven:maven-processor-plugin"));
      MavenPlugin compilerPlugin = facet.getPlugin(CoordinateBuilder
               .create("org.apache.maven.plugins:maven-compiler-plugin"));

      assertTrue(project.hasFacet(PersistenceMetaModelFacet.class));
      assertNotNull(processorPlugin);
      assertEquals(1, processorPlugin.listExecutions().size());
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   {
      if (!isInstalled())
      {
         Project project = getFaceted();
         project.getFacet(PackagingFacet.class).setPackagingType("ear");
         MavenPluginFacet plugins = project.getFacet(MavenPluginFacet.class);
         Coordinate mvnEarPluginDep = CoordinateBuilder.create().setGroupId("org.apache.maven.plugins")
                  .setArtifactId("maven-ear-plugin");
         MavenPlugin plugin;
         if (!plugins.hasPlugin(mvnEarPluginDep))
         {
            plugin = MavenPluginBuilder.create().setCoordinate(mvnEarPluginDep);
            plugins.addPlugin(plugin);
         }
      }
      return isInstalled();
   }
View Full Code Here

Examples of org.jboss.forge.addon.maven.projects.MavenPluginFacet

   @Override
   public DirectoryResource getWebRootDirectory()
   {
      Project project = getFaceted();
      MavenPluginFacet mavenPluginFacet = project.getFacet(MavenPluginFacet.class);
      final String webappFolderName;
      Coordinate mvnWarPluginDep = CoordinateBuilder.create("org.apache.maven.plugins:maven-war-plugin");
      if (mavenPluginFacet.hasPlugin(mvnWarPluginDep))
      {
         MavenPlugin warPlugin = mavenPluginFacet.getPlugin(mvnWarPluginDep);
         Configuration config = warPlugin.getConfig();
         if (config.hasConfigurationElement("warSourceDirectory"))
         {
            webappFolderName = config.getConfigurationElement("warSourceDirectory").getText();
         }
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.