Lifecycle
default, clean and site
Phase
When executes
mvn compile
Phase from validate to compile will be gone through.
Full list of phases is here.
Goal
In plugin goals are defined and are binded to phases. For example, the compile goal in maven-compiler-plugin is binded to compile phase.
The order of goal execution of plugins in the same phase is defined by entry order in the plugins section of the pom.xml file.
To list the plugin's goals is binded to the package phase.
mvn help:describe -Dcmd=package
To check goals and phases from plugin's source code
To configure frontend-maven-plugin plugin.
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.1</version>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
..
</executions>
</plugin>
Following is the class of defining install-node-and-npm and npm goal. They are binded to generate-resources phase.
@Mojo(name="install-node-and-npm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
public final class InstallNodeAndNpmMojo extends AbstractFrontendMojo {
// ...
}
@Mojo(name="npm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
public final class NpmMojo extends AbstractFrontendMojo {
// ...
}
Profile
- add/override properties
- add dependencies
- add plugin dependencies
- add pluginManagement dependencies
set default profile
<!-- (1) --->
<profiles>
<profile>
<activation>
<property>
<name>debug</name>
</property>
</activation>
...
</profile>
</profiles>
<!-- (2) --->
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
...
</profile>
override enabled profile
assumes profile dev is enabled by default, and to enable profile production
mvn -P=-dev,production
Top comments (0)