Usage

There are different ways to use the CoreMedia Application Plugin:

  • create a single application with the coremedia-application:package-inplace goal
  • package a single/merged CoreMedia Application with the coremedia-application:zip-it goal
  • create a single webstart application with the coremedia-application:package-webstart goal
  • package a single CoreMedia Webstart Application with the coremedia-application:war-it goal
  • merge multiple coremedia-applications / coremedia-webstart-applications with the coremedia-application:package-inplace goal
  • create native RPM packages with the coremedia-application:rpm goal

By default the goals package-inplace and package-webstart are bound to the prepare-package and the goals zip-it and war-it to the package phase.

To illustrate the general way of using the CoreMedia Application Plugin for coremedia-applications, here's a pom.xml of an example project:

<project>
  ...
  <groupId>com.coremedia.example.project</groupId>
  <artifactId>example-application</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>coremedia-application</packaging>

  <name>Example Application Project</name>

  <dependencies>
    <dependency>
      <groupId>com.coremedia.example.project</groupId>
      <artifactId>application-lib</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
  <finalName>applicationName</finalName>
   <plugins>
      <plugin>
        <groupId>com.coremedia.maven</groupId>
        <artifactId>coremedia-application-maven-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
   </plugins
  </build>
  ...
</project>

The project's structure looks like this:

 .
 |-- pom.xml
 `-- src
     `-- main
         `--app
            |--bin
            |  `--applicationName.jpif
            |--config
            |  `--applicationName
            |     `--spring
            |        `--applicationContext.xml
            `--properties
               `--corem
                  `--application.properties

Invoking

mvn package

or

mvn coremedia-application:package-inplace coremedia-application:zip-it

will generate the ZIP file target/applicationName-1.0-SNAPSHOT.zip. Here are the contents of that ZIP file:

applicationName-1.0-SNAPSHOT.zip
  |
  |--META-INF
  |  `--MANIFEST.MF
  |--bin
  |  `--applicationName.jpif
  |--config
  |  `--applicationName
  |     `--spring
  |        `--applicationContext.xml
  |--properties
  |  `--corem
  |     `-application.properties
  `--lib
     `--application-lib-1.0-SNAPSHOT.jar

To illustrate the general way of using the CoreMedia Application Plugin for coremedia-webstart-applications, here's a pom.xml of an example project:

<project>
  ...
  <groupId>com.coremedia.example.project</groupId>
  <artifactId>example-webstart-application</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>coremedia-webstart-application</packaging>

  <name>Example Webstart Application Project</name>

  <dependencies>
    <dependency>
      <groupId>com.coremedia.example.project</groupId>
      <artifactId>application-lib</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
  <finalName>applicationName</finalName>
   <plugins>
      <plugin>
        <groupId>com.coremedia.maven</groupId>
        <artifactId>coremedia-application-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <jnlpTemplate>src/main/jnlp/myJnlpTemplate.vm</jnlpTemplate>
          <signConfig>
            <alias>coremedia</alias>
            <keystore>src/sign/webstart.keystore</keystore>
            <keypass>coremedia</keypass>
            <storepass>coremedia</storepass>
          </signConfig>
          <mainClassArtifact>com.coremedia.example.project:application-lib</mainClassArtifact>
          <mainClass>com.coremedia.example.Main</mainClass>
          <nativeLib>native</nativeLib>
        </configuration>
      </plugin>
   </plugins
  </build>
  ...
</project>

The project's structure looks like this:

 .
 |-- pom.xml
 `-- src
     |-sign
     | `-webstart.keystore
     `-- main
         |-jnlp
         | `-myJnlpTemplate.vm
         `--webapp
            |-index.html
            |-WEB-INF
            | `-web.xml
            `-webstart
              |-native
              | `-native-lib.jar
              `--properties
                 `--corem
                    `--application.properties

Invoking

mvn package

or

mvn coremedia-application:package-webstart coremedia-application:war-it

will generate the war file target/applicationName-1.0-SNAPSHOT.war. Here are the contents of that war file:

applicationName-1.0-SNAPSHOT.war
  |
  |--META-INF
  |  `--MANIFEST.MF
  |-index.html
  |-WEB-INF
  | `-lib
  |   `-webstart-jnlp-servlet:1.0-6.0-02_ea_b02.jar
  `-webstart
    |-applicationName.jnlp
    |-versions.xml
    |--properties
    |  `--corem
    |     `-application.properties
    |-native
    | `-native-lib.jar
    `--lib
       `--application-lib-1.0-SNAPSHOT.jar