Maven is a plugin execution platform. At its heart, all work is done by plugins.There are two kinds of plugins: build plugin and reporting plugin.Build plugin will be executed during the build and they should be configured in the <build> element from POM.Here are the plugin list referred from maven office site:plugin list.In addtion, there are also useful plugins from third party like codehaus:maven plugin list.
To use a plugin in maven, there are also two ways. One is using the plugin's goal in the command line directly, the other is binding the plugin's goal to life-cycle's phase.I will take Maven Exec Plugin for example to show how to use it in this recipe.
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
...
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.example.Main</mainClass>
<arguments>
<argument>argument1</argument>
...
</arguments>
<systemProperties>
<systemProperty>
<key>myproperty</key>
<value>myvalue</value>
</systemProperty>
...
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
You can use <phase>clean</phase>
inside of <execution> element to run com.example.Main class during clean life-cycle.There is an interesting plugin forAndroid:https://github.com/jayway/maven-android-plugin. You can use this plugin to buildandroidproject if you developandroidprojects.