Building a DAR file
You can use the Maven™ plugin mvndar to build and deploy your publisher DAR file. Alternatively, you can use an Ant™ build file to perform the same function.
Building a DAR file using mvndar (recommended)
The mvndar plugin for Maven is developed and maintained on GitHub: https://github.com/pushtechnology/mvndar.
To use mvndar, include the following XML in your pom.xml file.
- Link to the Push repository in the pluginRepositories
section:
<pluginRepositories> ... <pluginRepository> <id>push-repository</id> <url>http://download.pushtechnology.com/maven/</url> </pluginRepository> ... </pluginRepositories>
- Reference mvndar in the plugins section:
<plugins> ... <plugin> <groupId>com.pushtechnology.tools</groupId> <artifactId>dar-maven-plugin</artifactId> <version>1.2</version> <extensions>true</extensions> </plugin> ... </plugins>
The plugin runs during the project's package phase and creates the DAR file in the target directory.
Building a DAR file using Apache™ Ant
The following example build.xml for Ant takes a publisher developed as an Eclipse™ project, packages it in a temporary directory, and copies it to the directory where the Ant script is executed:
<project name="MyPublisher" default="maketmpable"> <property name="publisher.name" value="MyPublisher" /> <property name="jar.name" value="${publisher.name}.jar" /> <property name="diffusion.dir" value="." /> <property name="dar.name" value="${publisher.name}.dar" /> <target name="makejar"> <jar jarfile="${jar.name}" includes="**/*.class" basedir="." /> </target> <target name="maketmpable" depends="makejar"> <tempfile property="temp.file" destDir="${java.io.tmpdir}" prefix="publisher-name"/> <copy todir="${temp.file}/${publisher.name}"> <fileset dir="."> <include name="etc/**" /> <include name="ext/**" /> <include name="html/**" /> <include name="META-INF/**" /> </fileset> </copy> <copy todir="${temp.file}/${publisher.name}" file="${jar.name}" /> <jar jarfile="${dar.name}" includes="${publisher.name}/**" basedir="${temp.file}" manifest="META-INF/MANIFEST.MF" /> <delete dir="${temp.file}" /> </target> </project>