The Diet Maven Mojo is a Maven Mojo that provides an easy to use interface to the Diet Engine for projects that are built by Maven.
To include the plugin as a part of your build you would need to only add this to your pom.xml file :
<build>
<plugins>
<plugin>
<groupId>org.codarama.diet</groupId>
<artifactId>diet-maven-mojo</artifactId>
<version>0.0.1</version>
</plugin>
</plugins>
</build>
, and then execute the goal as follows :
mvn clean diet:putondiet install
If you are bold enough you could simply put the plugin as part of one of the existing phases :
<build>
<plugins>
<plugin>
<groupId>org.codarama.diet</groupId>
<artifactId>diet-maven-mojo</artifactId>
<version>1.0.0</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>putondiet</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
, and then executing any goal that includes the package phase would also execute the mojo :
mvn clean install
<build>
<plugins>
<plugin>
<groupId>org.codarama.diet</groupId>
<artifactId>diet-maven-mojo</artifactId>
<version>1.0.0</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>putondiet</goal>
</goals>
</execution>
</executions>
<configuration>
<sources>/home/root/project/sources</sources>
<libs>/usr/local/jdk/libs</libs>
<target>/home/root/project/target</target>
<forceInclude>
<lib>/usr/local/jdk/libs/myRuntimeLibrary1.jar</lib>
<lib>/usr/local/jdk/libs/myRuntimeLibrary2.jar</lib>
<lib>/usr/local/jdk/libs/myRuntimeLibrary3.jar</lib>
</forceInclude>
</configuration>
</plugin>
</plugins>
</build>
Where: