I have implemented a Maven 2 plugin.
I have that definiton for my Mojo:
/**
* Goal which combines files.
*
* @goal combine
* @phase compile
*/
public class CombineMojo extends AbstractMojo {
I have to add this into my project (which uses plugin) pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>base-project</groupId>
<artifactId>base-project</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>combine-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<input>src/input.html</input>
<output>html/output.html</output>
</configuration>
<executions>
<execution>
<id>combine-maven-plugin</id>
<goals>
<goal>combine</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
However what should I do automatically execute it instead of defining at pom.xml. I tries adding
@execute ...
into my Mojo definition however it didn't work. By the way should I define an id, what is need for it?