0 Replies Latest reply on Feb 11, 2015 1:14 AM by mani_mylavarapu

    How to install a plugin in maven

    mani_mylavarapu

      Hello,

      I am trying to install a plugin in maven.So the end application is updating pom.xml something like

      <plugin>

      <groupId>br.com.ingenieux</groupId>

        <artifactId>jbake-maven-plugin</artifactId>

        <executions>

        <execution>

        <id>default-generate</id>

        <phase>generate-resources</phase>

        <goals>

        <goal>generate</goal>

        </goals>

                </execution>

        </executions>

        </plugin>

      Now i have written code for this

       

      Coordinate compiler =  CoordinateBuilder.create("br.com.ingenieux:jbake-maven-plugin");

      MavenPluginBuilder builder = MavenPluginBuilder.create().setCoordinate(compiler).addExecution(ExecutionBuilder.create().setPhase("default-generate").setPhase("generate-resources").addGoal("generate"));

      Plugin plugin = new MavenPluginAdapter(builder);

       

      But when i run this command the pom.xml is not updated.I know i have only constructed plugin object.Is there any way to install this just like how we use DependencyInstaller for installing dependecies.