0

We have custom maven plugin which consist of multiple goals like

@Mojo(name = "BUILD", defaultPhase=LifecyclePhase.COMPILE)

@Mojo(name = "BUILDXML", defaultPhase=LifecyclePhase.COMPILE)

now I have created another goal which BUILDVAL below is the code

@Mojo(name = "BUILDVAL)
public class Validation extends AbstractMojo {

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        // From here I need to call BUILD and BUILDXML goals.
        System.out.println("Test");
    }
}

so from above execute() method i need to call BUILD and BUILDXML goals. I am quite to new Maven plugin development so it might sounds easy.

Thanks in advance.

vinod
  • 1,178
  • 4
  • 16
  • 42
  • 1
    possible duplicate of http://stackoverflow.com/questions/526733/maven-plugin-executing-another-plugin – Redlab Feb 15 '17 at 08:15
  • Thanks RedLab but if possible could you please provide something at code level :) – vinod Feb 16 '17 at 08:14
  • yes, see https://github.com/TimMoore/mojo-executor – Redlab Feb 16 '17 at 08:20
  • @Redlab I have used maven invoker but not able to find out how to skip the test in setGoal method http://stackoverflow.com/questions/42338476/maven-invoker-skiping-test-in-goals – vinod Feb 20 '17 at 07:13

0 Answers0