coremedia-application:package-webstart

Full name:

com.coremedia.maven:coremedia-application-maven-plugin:2.8.3:package-webstart

Description:

This mojo produces artifacts of type coremedia-webstart-application. It can be used in two different fashions:
  • assemble all given resources, download all jar dependencies and sign them.
  • unpack a dependency of packaging type coremedia-application and sign all contained jar artifacts.
The jnlp file for the resulting webapp will be created from a provided jnlp template using the velocity templating engine. The jars will be signed by using the maven-jarsigner-plugin internally. The artifacts that are produced by this mojo can be referenced as war dependencies, eg. for merging war and coremedia-application artifacts with the package-place goal.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.2.
  • Binds by default to the lifecycle phase: compile.

Optional Parameters

Name Type Since Description
configDir File 2.4 The directory where override configuration files should be placed. All files found here will be used to process files found below the @{link outputDirectory} using the same relative path starting from this directory. The override configuration files can contain tokens as they are being filtered first to a temporary directory. This mechanism supports only *.properties files. If an override configuration file and its target configuration file are found, the target is loaded and its values will be overridden with the values found in the override configuration file.
Default value is: src/main/override-properties.
dependencyFiltering boolean 2.4 Controls whether dependent artifacts (war,zip) should be filtered during extraction
Default value is: false.
dependencyFilteringPattern String[] 2.4 Filepattern to define the files to filter during extraction of dependencyArtifacts and Overlays.
deploymentRuleSet File 2.2 Deployment ruleset definition, optional since JRE 1.7.0_51 If exists, a signed DeploymentRuleSet.jar will be created in the projects target directory.
Default value is: ${project.basedir}/src/main/ruleset/ruleset.xml.
encoding String 2.2 The character encoding scheme to be applied when filtering the static application resources.
Default value is: ${project.build.sourceEncoding}.
escapeWindowsPaths boolean 2.5 Whether to escape backslashes and colons in windows-style paths.
Default value is: true.
excludeTransitiveJars boolean 2.4 Set to true to exlude copying of transitive jar dependencies
Default value is: false.
jnlpDownloadServlet String 2.2 A string defining the artifact containing the jnlp webstart servlet. The string is expected to be formatted with the pattern groupId:artifactId:version.
Default value is: org.codehaus.mojo.webstart:webstart-jnlp-servlet:1.0-6.0-02_ea_b02.
jnlpSpec String 2.2 The version of the jnlp spec. This parameter will be provided as velocity placeholder for the jnlp template.
Default value is: 1.0+.
jnlpTemplate String 2.2 The relative path to the jnlp template. The jnlp template file has to be an xml file that can contain the following velocity placeholder:
  • $jnlpSpec which will be replaced with the content of PackageWebstartMojo.jnlpSpec
  • $dependencies which will be replaced with the jar resources entries
  • $mainClass which will be replaced with the content of PackageWebstartMojo.mainClass
  • $$context is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the Base URL for the Web Archive.
  • $$codebase is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the complete URL.
  • $$name is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the name of the JNLP file.
  • $$site is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the Web site address without the WAR context portion
The template may look like the following example:
<jnlp spec="$jnlpSpec" codebase="$$codebase" context="$$context" href="$$name">
 <information>
   <title>Test</title>
   <vendor>test</vendor>
   <homepage href="http://www.coremedia.com"/>
   <description>test</description>
 </information>

 <security>
   <all-permissions/>
 </security>

 <resources>
   <java version="1.6+" initial-heap-size="512m" max-heap-size="1024m"/>

     $dependencies

 </resources>

 <application-desc main-class="$mainClass"/>
 <component-desc/>
</jnlp>

You can find a description of the JNLP download servlet here.


Default value is: src/main/jnlp/jnlpTemplate.vm.
mainClass String 2.2 The main class of the application.
mainClassArtifact String 2.2 A string defining the artifact containing the main class. The string is expected to be formatted with the pattern groupId:artifactId:version e.g. com.coremedia.cms:cap-editor:5.3.20
nativeLibPath String 2.2 The directory below the PackageWebstartMojo.webstartResourcesContext where native libaries are placed.
Default value is: nativelib.
outputDirectory File 2.0 Location of the assembled application.

Default value is: ${project.build.directory}/${project.build.finalName}.
overlays List 2.1 With overlays you can define includes and excludes for each coremedia-application dependency to be extracted during the packaging. Be aware, that you cannot influence the order of extraction, which is fixed by the order in the dependency tree. Files extracted first won't be overwritten, except by files from the module itself. To define an overlay simply add something like :
 <overlays>
   <overlay>
     <artifactId>foo</artifactId>
     <groupId>bar</groupId>
     <excludes>
       <exclude>forbidden.xml</exclude>
     </excludes>
   </overlay>
 </overlays>


signConfig SignConfig 2.2 The sign config defines all necessary parameters you need to configure the signing process. Internally these parameters are being delegated to the maven-jarsigner-plugin in version 1.2. Possible configuration options are provided: <signConfig> <alias>the alias name for the keystore entry for that signer, required</alias> <keystore>the path to the keystore, required</keystore> <storetype>the type of the store, defaults to Keystore.getDefaultType()</keystore> <keypass>the key password, required</keypass> <storepass>the store password, required</storepass> <verbose>set to true for verbose sign output, default is false</verbose> <verify>set to true to verify the signing afterwards, default is false</verify> <skip>set to true to skip the signing, default is false</skip> <maxMemory>maximum heap for signing, default is 256m</maxMemory> <unsign>set to true to unsign, already signed artifacts, default is true</unsign> <certs>set to true to output certificate informations during verify, default is false</certs> <useTsa>set to true to use TSA timestamping</useTsa> <tsaUrl>the URL of the TSA service</tsaUrl> <arguments> <argument>an argument that needs to be added to the jarsigner call</argument> <argument>another argument</argument> </arguments> </signConfig> To see what the options are doing in detail look here.
stripJarVersions boolean 2.4 Strip artifact version during copying of jar artifacts
Default value is: false.
useVersionsXml boolean 2.2 Whether a version.xml should be generated for the webstart application. This version.xml is honored by the webstart-jnlp-servlet to only download artifacts that aren't found in the webstart cache. This feature won't work if you are depending on a coremedia-application artifact that contains jars, as it is impossible to determine the versions correctly.
Default value is: true.
webappResources Resource[] 2.2 The list of static application resources we want to transfer.
Default value is:
<webappResources>  
  <resource> 
    <directory>src/main/webapp</directory>
    <includes>
      <include>**/*.xml</include>
      <include>**/*.properties</include>   
      <include>**/*.txt</include>   
    </includes>
    <filtering>true</filtering>
  </resource>
  <resource>
    <directory>src/main/webapp</directory>
    <excludes> 
      <exclude>**/*.xml</exclude>
      <exclude>**/*.properties</exclude>
      <exclude>**/*.txt</exclude>
    </excludes>
    <filtering>false</filtering>
  </resource>
</webappResources> 


webstartResourcesContext String 2.2 The directory under which the webstart application will be assembled within the webapp.
Default value is: webstart.

Parameter Details

configDir:

The directory where override configuration files should be placed. All files found here will be used to process files found below the @{link outputDirectory} using the same relative path starting from this directory. The override configuration files can contain tokens as they are being filtered first to a temporary directory. This mechanism supports only *.properties files. If an override configuration file and its target configuration file are found, the target is loaded and its values will be overridden with the values found in the override configuration file.
  • Type: java.io.File
  • Since: 2.4
  • Required: No
  • Default: src/main/override-properties

dependencyFiltering:

Controls whether dependent artifacts (war,zip) should be filtered during extraction
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: false

dependencyFilteringPattern:

Filepattern to define the files to filter during extraction of dependencyArtifacts and Overlays.
  • Type: java.lang.String[]
  • Since: 2.4
  • Required: No

deploymentRuleSet:

Deployment ruleset definition, optional since JRE 1.7.0_51 If exists, a signed DeploymentRuleSet.jar will be created in the projects target directory.
  • Type: java.io.File
  • Since: 2.2
  • Required: No
  • Default: ${project.basedir}/src/main/ruleset/ruleset.xml

encoding:

The character encoding scheme to be applied when filtering the static application resources.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: ${project.build.sourceEncoding}

escapeWindowsPaths:

Whether to escape backslashes and colons in windows-style paths.
  • Type: boolean
  • Since: 2.5
  • Required: No
  • Default: true

excludeTransitiveJars:

Set to true to exlude copying of transitive jar dependencies
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: false

jnlpDownloadServlet:

A string defining the artifact containing the jnlp webstart servlet. The string is expected to be formatted with the pattern groupId:artifactId:version.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: org.codehaus.mojo.webstart:webstart-jnlp-servlet:1.0-6.0-02_ea_b02

jnlpSpec:

The version of the jnlp spec. This parameter will be provided as velocity placeholder for the jnlp template.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: 1.0+

jnlpTemplate:

The relative path to the jnlp template. The jnlp template file has to be an xml file that can contain the following velocity placeholder:
  • $jnlpSpec which will be replaced with the content of PackageWebstartMojo.jnlpSpec
  • $dependencies which will be replaced with the jar resources entries
  • $mainClass which will be replaced with the content of PackageWebstartMojo.mainClass
  • $$context is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the Base URL for the Web Archive.
  • $$codebase is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the complete URL.
  • $$name is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the name of the JNLP file.
  • $$site is an escaped in-built placeholder of the jnlp-download servlet. It will replace at download time with the Web site address without the WAR context portion
The template may look like the following example:
<jnlp spec="$jnlpSpec" codebase="$$codebase" context="$$context" href="$$name">
 <information>
   <title>Test</title>
   <vendor>test</vendor>
   <homepage href="http://www.coremedia.com"/>
   <description>test</description>
 </information>

 <security>
   <all-permissions/>
 </security>

 <resources>
   <java version="1.6+" initial-heap-size="512m" max-heap-size="1024m"/>

     $dependencies

 </resources>

 <application-desc main-class="$mainClass"/>
 <component-desc/>
</jnlp>

You can find a description of the JNLP download servlet here.

  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: src/main/jnlp/jnlpTemplate.vm

mainClass:

The main class of the application.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

mainClassArtifact:

A string defining the artifact containing the main class. The string is expected to be formatted with the pattern groupId:artifactId:version e.g. com.coremedia.cms:cap-editor:5.3.20
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

nativeLibPath:

The directory below the PackageWebstartMojo.webstartResourcesContext where native libaries are placed.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: nativelib

outputDirectory:

Location of the assembled application.
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • Default: ${project.build.directory}/${project.build.finalName}

overlays:

With overlays you can define includes and excludes for each coremedia-application dependency to be extracted during the packaging. Be aware, that you cannot influence the order of extraction, which is fixed by the order in the dependency tree. Files extracted first won't be overwritten, except by files from the module itself. To define an overlay simply add something like :
 <overlays>
   <overlay>
     <artifactId>foo</artifactId>
     <groupId>bar</groupId>
     <excludes>
       <exclude>forbidden.xml</exclude>
     </excludes>
   </overlay>
 </overlays>

  • Type: java.util.List
  • Since: 2.1
  • Required: No

signConfig:

The sign config defines all necessary parameters you need to configure the signing process. Internally these parameters are being delegated to the maven-jarsigner-plugin in version 1.2. Possible configuration options are provided: <signConfig> <alias>the alias name for the keystore entry for that signer, required</alias> <keystore>the path to the keystore, required</keystore> <storetype>the type of the store, defaults to Keystore.getDefaultType()</keystore> <keypass>the key password, required</keypass> <storepass>the store password, required</storepass> <verbose>set to true for verbose sign output, default is false</verbose> <verify>set to true to verify the signing afterwards, default is false</verify> <skip>set to true to skip the signing, default is false</skip> <maxMemory>maximum heap for signing, default is 256m</maxMemory> <unsign>set to true to unsign, already signed artifacts, default is true</unsign> <certs>set to true to output certificate informations during verify, default is false</certs> <useTsa>set to true to use TSA timestamping</useTsa> <tsaUrl>the URL of the TSA service</tsaUrl> <arguments> <argument>an argument that needs to be added to the jarsigner call</argument> <argument>another argument</argument> </arguments> </signConfig> To see what the options are doing in detail look here.
  • Type: com.coremedia.cms.maven.application.webstart.SignConfig
  • Since: 2.2
  • Required: No

stripJarVersions:

Strip artifact version during copying of jar artifacts
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: false

useVersionsXml:

Whether a version.xml should be generated for the webstart application. This version.xml is honored by the webstart-jnlp-servlet to only download artifacts that aren't found in the webstart cache. This feature won't work if you are depending on a coremedia-application artifact that contains jars, as it is impossible to determine the versions correctly.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • Default: true

webappResources:

The list of static application resources we want to transfer.
Default value is:
<webappResources>  
  <resource> 
    <directory>src/main/webapp</directory>
    <includes>
      <include>**/*.xml</include>
      <include>**/*.properties</include>   
      <include>**/*.txt</include>   
    </includes>
    <filtering>true</filtering>
  </resource>
  <resource>
    <directory>src/main/webapp</directory>
    <excludes> 
      <exclude>**/*.xml</exclude>
      <exclude>**/*.properties</exclude>
      <exclude>**/*.txt</exclude>
    </excludes>
    <filtering>false</filtering>
  </resource>
</webappResources> 

  • Type: org.apache.maven.model.Resource[]
  • Since: 2.2
  • Required: No

webstartResourcesContext:

The directory under which the webstart application will be assembled within the webapp.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Default: webstart