Just a second...

Build publishers with Maven

The Diffusion™ API for publishers is not available in the Push Technology public Maven™ repository. To build publishers, you must install the product locally and depend on diffusion.jar using a Maven system scope.

DAR files

The preferred way to deploy publishers is to build them into a DAR. DARs are JAR format files that contain compiled code, libraries, and configuration. They have a similar purpose to Java™ EE EAR or WAR files, and can be dynamically deployed to and undeployed from a running Diffusion server

Figure 1. Example folder structure inside a DAR file The root folder name is the name of the publisher. It contains the following folders: META-INF, etc, ext, html. The META-INF folder contains a manifest file, MANIFEST.MF. The etc folder contains the following configuration files: Aliases.xml, Publishers.xml, SubscriptionValidationPolicy.xml. The ext folder contains the JAR file, MyPublisher.jar. The html folder contains the index.html file.
The root folder name is the name of the publisher. For example, MyPublisher.
  • The META-INF directory contains the MANIFEST.MF file.

    This file contains an attribute, Diffusion-Version, which specifies the minimum version number of Diffusion on which this publisher runs. This prevents deployment of publishers to Diffusion instances which might not support features of the publisher or have different API signatures.

    Manifest-Version: 1.0
    Diffusion-Version: 6.2.7
  • The etc directory can contain the following files.
    etc/Publishers.xml
    You must include this file.

    The Publishers.xml file has the same structure and the one in a Diffusion installation's etc directory. For more information, see .

    For example:
    <publishers>
            <publisher name="MyPublisher">
                    <class>com.pushtechnology.diffusion.test.publisher.MyPublisher</class>
                    <start>true</start>
                    <enabled>true</enabled>
            </publisher>
    </publishers>
    etc/Aliases.xml (optional)
    Include this file if there are associated HTML files.
    etc/SubscriptionValidationPolicy.xml
    Include this file if it is referenced from the etc/Publishers.xml file.
    These files are normally found in the Diffusion server installation's etc directory, but contain only information relating to the publisher being deployed. Files that affect the operation of the Diffusion server and have no relationship to the publisher are not loaded.
  • The ext directory contains all Java code required by your publisher.

    You can also include any required third-party JAR files or resources in this folder.

  • The html is optional and can contain any HTML files or web assets required by the publisher.

mvndar

The preferred way to build a DAR mvndar is a Maven plugin for creating DAR files. More information about mvndar is available at the following locations:

Example: Using Maven to build the demo applications

If you selected the demo applications when you installed Diffusion, the source files and an example Maven pom.xml can be found in the directories beneath the demos/src directory. The example uses mvndar, and depends on diffusion.jar using system scope.

For more information, see .