Package org.apache.maven.model

Examples of org.apache.maven.model.Profile


      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertNull(model.getBuild());
      List<Profile> profiles = model.getProfiles();
      Assert.assertEquals(1, profiles.size());
      Profile profile = profiles.get(0);
      assertProfileMatch(TEST_PROFILE_ID, profile);
      assertCoordinateMatch(PLUGIN_COORDINATE, profile.getBuild().getPlugins().get(0));
   }
View Full Code Here


      MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
      Model model = mavenFacet.getModel();
      Assert.assertNull(model.getBuild());
      List<Profile> profiles = model.getProfiles();
      Assert.assertEquals(1, profiles.size());
      Profile profile = profiles.get(0);
      assertProfileMatch(TEST_PROFILE_ID, profile);
      Assert.assertTrue(profile.getBuild().getPlugins().isEmpty());
      assertCoordinateMatch(PLUGIN_COORDINATE, profile.getBuild().getPluginManagement().getPlugins().get(0));
   }
View Full Code Here

               ProfileBuilder.create()
                        .setId("myid")
                        .setActiveByDefault(true)
                        .addDependency(DependencyBuilder.create("mygroupId:myartifactId"))
                        .addRepository(new DependencyRepository("id", "url"));
      Profile mavenProfile = profileBuilder.getAsMavenProfile();
      assertThat(mavenProfile.getId(), is(profileBuilder.getId()));
   }
View Full Code Here

               ProfileBuilder.create()
                        .addProperty("prop1", "val1")
                        .addProperty("prop2", "val2")
                        .addProperty("prop3", "prop3");

      Profile mavenProfile = profileBuilder.getAsMavenProfile();
      assertThat(mavenProfile.getProperties().size(), is(3));
   }
View Full Code Here

               ProfileBuilder.create()
                        .setId("myid")
                        .setActiveByDefault(true)
                        .addDependency(DependencyBuilder.create("mygroupId:myartifactId"))
                        .addRepository(new DependencyRepository("id", "url"));
      Profile mavenProfile = profileBuilder.getAsMavenProfile();
      assertThat(mavenProfile.getId(), is(profileBuilder.getId()));
   }
View Full Code Here

      ProfileBuilder profileBuilder =
               ProfileBuilder.create()
                        .addProperty("prop1", "val1")
                        .addProperty("prop2", "val2")
                        .addProperty("prop3", "prop3");
      Profile mavenProfile = profileBuilder.getAsMavenProfile();
      assertThat(mavenProfile.getProperties().size(), is(3));
   }
View Full Code Here

      {
         if (!hasPluginRepository(url, profileParam))
         {
            MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
            Model pom = maven.getModel();
            Profile profile = getProfile(pom, profileParam);
            if (profile == null)
            {
               profile = profileParam.getAsMavenProfile();
               pom.getProfiles().add(profile);
            }
            Repository repo = new Repository();
            repo.setId(id);
            repo.setUrl(url);
            profile.addPluginRepository(repo);
            maven.setModel(pom);
         }
      }
   }
View Full Code Here

         if (url != null)
         {
            String trimmedUrl = url.trim();
            MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
            Model pom = maven.getModel();
            Profile profile = getProfile(pom, profileParam);
            if (profile != null)
            {
               for (Repository repo : profile.getPluginRepositories())
               {
                  if (repo.getUrl().trim().equals(trimmedUrl))
                  {
                     return true;
                  }
View Full Code Here

         if (url != null)
         {
            String trimmedUrl = url.trim();
            MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
            Model pom = maven.getModel();
            Profile profile = getProfile(pom, profileParam);
            if (profile != null)
            {
               List<Repository> repos = profile.getPluginRepositories();
               for (Repository repo : repos)
               {
                  if (repo.getUrl().equals(trimmedUrl))
                  {
                     repos.remove(repo);
View Full Code Here

      else
      {
         List<DependencyRepository> results = new ArrayList<>();
         MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
         Model pom = maven.getModel();
         Profile profile = getProfile(pom, profileParam);
         if (profile != null)
         {
            for (Repository repo : profile.getPluginRepositories())
            {
               results.add(new DependencyRepository(repo.getId(), repo.getUrl()));
            }
         }
         return Collections.unmodifiableList(results);
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Profile

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.