-1

I'm writing a plugin for Maven. However, it only makes sense to run my plugin after running mvn compile and mvn test-compile. How can I ensure that these goals are run before my plugin's goals?

Below are the current annotation parameters I'm using, but they don't seem to have the intended effect.

@Mojo(name = "testplugin",
      defaultPhase = LifecyclePhase.TEST,
      requiresDependencyResolution = ResolutionScope.TEST)
Reed Oei
  • 1,427
  • 2
  • 13
  • 19

1 Answers1

-1

There's another annotation @Execute (https://maven.apache.org/plugin-tools/maven-plugin-plugin/examples/using-annotations.html) that can be used for this purpose. In this particular case, you need to add the following annotation:

@Execute(phase = LifecyclePhase.TEST_COMPILE,
         goal = "test-compile")
Reed Oei
  • 1,427
  • 2
  • 13
  • 19