1 Reply Latest reply on Apr 25, 2015 11:44 AM by J Buddha

    How to add Parent POM to an existing POM using Forge API

    J Buddha Newbie

      I'm creating an addon that updates the existing POM, I'm able to add dependencies, repository, and various other information using DependencyFacet, MavenFacet etc., However, I'm unable to figure out how to add a parent POM. Following is the code I tried and it didn't work. Any help is appreciated as to which facet I can use and what is the syntax to use it.

       

           Parent p = new Parent();
           p.setGroupId("org.codehaus.griffon");
           p.setArtifactId("application-master-pom");
           p.setVersion("1.1.0");
           MavenFacet mavenFacet = getFaceted().getFacet(MavenFacet.class);
           mavenFacet.getModel().setParent(p);