This page contains some examples of how to use the mvndar plugin.
To use the plugin, reference it from your project's pom.xml file.
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.acme</groupId> <artifactId>mypublisher</artifactId> <version>1.23</version> <packaging>dar</packaging> ... <pluginRepositories> <pluginRepository> <id>push-repository</id> <url>http://download.pushtechnology.com/maven/</url> </pluginRepository> </pluginRepositories> ... <build> <plugins> ... <plugin> <groupId>com.pushtechnology.tools</groupId> <artifactId>dar-maven-plugin</artifactId> <version>1.3</version> <extensions>true</extensions> </plugin> ... </plugins> </build> ... </project>
The <extensions>true</extensions> line is required so that Maven knows the plugin defines a new packaging type.
With the packaging type of the project set to dar as shown, the plugin will run whenever the project passes the "package" phase. You can execute it using the command below:
mvn package
The dar file will be generated in your project's target directory.
The plugin will package the project's compiled classes and resources in the ext directory of the DAR file so they are available in the runtime classpath when it is deployed to a Diffusion server.
A subset of the project's dependencies will be added to the ext directory. The following rules are used to filter the dependencies.
Any content in etc, or html subdirectories of src/main/diffusion will be added to the DAR file.
You can customise the project output that is included or excluded by specifying a list of fileset patterns using <outputIncludes>/</outputInclude> or <outputExcludes>/</outputExclude>.
Similarly, you can filter the content from src/main/diffusion using <diffusionIncludes>/<diffusionInclude> or </diffusionExcludes>/</diffusionExclude>.
A Diffusion-Version entry will be added to the DAR manifest.
The Diffusion-Version entry value defaults to 4.5.0. It can be changed using <minimumDiffusionVersion>.
<project> ... <build> <plugins> ... <plugin> <groupId>com.pushtechnology.tools</groupId> <artifactId>dar-maven-plugin</artifactId> <version>1.3</version> <extensions>true</extensions> <configuration> <minimumDiffusionVersion>6.0.0</minimumDiffusionVersion> </configuration> </plugin> ... </plugins> </build> ... </project>
To handle archiving, the Maven DAR Plugin uses Maven Archiver 2.5. This allows control over the DAR manifest, whether the Maven pom.xml and pom.properties files are added to the DAR, and whether the DAR file is compressed.
For example, here's how to add implementation entries to the manifest.
<project> ... <build> <plugins> ... <plugin> <groupId>com.pushtechnology.tools</groupId> <artifactId>dar-maven-plugin</artifactId> <version>1.3</version> <extensions>true</extensions> <configuration> <archiver> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archiver> </configuration> </plugin> ... </plugins> </build> ... </project>