Lifecycle, phases and goals

Figure 565. Phases Slide presentation Create comment in forum

Figure 566. Maven lifecyles and phases Slide presentation Create comment in forum
Phases:

clean, compile, test, package, deploy, ...

Lifecycle

Sequence of named phases

Example: mvn clean (Lifecycle)
  • pre-clean

  • clean (Phase)

  • post-clean

See Default Lifecycle.


Figure 567. hooking into phase Slide presentation Create comment in forum
<plugin>
  <groupId>com.mysema.maven</groupId>
  <artifactId>apt-maven-plugin</artifactId>
  <version>1.1.3</version>
  <executions>
    <execution>
      <id>process</id>
      <goals>
        <goal>process</goal>
      </goals>
      <phase>generate-sources</phase>
      <configuration>
        <outputDirectory>${project.build.directory}/metamodel</outputDirectory>
        <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
      </configuration>
      ...