How to rename goals in Maven?

Posted by mjs on Stack Overflow See other posts from Stack Overflow or by mjs
Published on 2010-04-29T10:04:26Z Indexed on 2010/04/29 10:07 UTC
Read the original article Hit count: 310

Filed under:
|
|

In the Maven document Introduction to the Build Lifecycle, a goal of display:time is described that outputs the current time. The plugin is as follows:

...
<plugin>
  <groupId>com.mycompany.example</groupId>
  <artifactId>maven-touch-plugin</artifactId>
  <version>1.0</version>
  <executions>
    <execution>
      <phase>process-test-resources</phase>
      <goals>
        <goal>timestamp</goal>
      </goals>
    </execution>
  </executions>
</plugin>
...

I have several questions relating to this plugin:

  1. How can I change the name of the goal to, for example, foo:bar? (Why does neither display nor time appear anywhere in the XML fragment? How can you tell, from looking at the fragment, what goals it defines?)
  2. How can I manually run this goal? (For similar constructs, the equivalent of mvn display:time sometimes works, but this doesn't work consistently.)
  3. How can I see if this goal exists? (i.e. list available goals; this question suggests this is impossible.)

© Stack Overflow or respective owner

Related posts about maven

Related posts about goal