1
votes

I want to do something between instrumentation and test when I run command mvn cobertura:cobertura.

The goal 'cobertura' in this command originally depends on 'instrument' and what I want is to do sth after this 'instrument' process and then run test my idea is abstract my requirement into a maven plugin, called like 'my-plugin' and is there a way to make it run between the two cobertura goals(instrument, test)

1

1 Answers

0
votes

You need to define two executions of the cobertura plugin which can be achieved like the following:

  <plugin>
    <groupId>...</groupId>
    <artifactId>..</artifactId>
    <version>...</version>
    <executions>
      <execution>
        <id>instrument</id>
        <goals><goal>instrument</goal></goals>
        <phase>process-test-classes</phase>
      </execution>
      <execution>
        <id>test</id>
        <goals><goal>cobertura</goal></goals>
        <phase>test</phase>
      </execution>
    </executions>
  </plugin>