coremedia-application:package-inplace

Full name:

com.coremedia.maven:coremedia-application-maven-plugin:2.7.9:package-inplace

Description:

This mojo servers two very distinct purposes:
  • Generate a single runnable CoreMedia application.
  • Aggregate multiple CoreMedia applications into a single deployable unit with shared lib,bin and configurations folders. Optionally also war artifacts can be aggregated into a common servlet-container (only tomcat is supported).
Generate a single runnable application
  1. The application is generated in the ${project.build.directory}/${project.build.finalName}/ folder by unpacking all coremedia-application or zip dependencies and copying all JAR dependencies of them in the ${project.build.directory}/${project.build.finalName}/lib folder.
  2. In the last step all file in the sourceDirectory are copied over the unpacked dependent zips to allow overwriting of configuration etc. in the last step of assembling the application.
Merge multiple applications

All dependencies of type coremedia-application and of type zip are detected as candidates to merge and they are handled as if it were base artifacts for a single coremedia application described above. Be aware that this feature cannot be used for skinny coremedia-application artifacts e.g. no dependencyManagement can be applied to the extraction of the dependencies.

Merge war artifacts

If there are also war dependencies, the mojo extracts them into a webapps folder below the configurable tomcatPath root. Be aware that this feature cannot be used for skinny war artifacts e.g. no dependencyManagement can be applied to the war extraction.

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.
  • Binds by default to the lifecycle phase: compile.

Optional Parameters

Name Type Since Description
appResources Resource[] - The list of static application resources we want to transfer.
Default value is:
<appResources>  
  <resource> 
    <directory>src/main/app</directory>
    <includes>
      <include>**/*.xml</include>
      <include>**/*.jpif</include>    
      <include>**/*.properties</include>   
      <include>**/*.txt</include>   
    </includes>
    <filtering>true</filtering>
  </resource>
  <resource>
    <directory>src/main/app</directory>
    <excludes> 
      <exclude>**/*.xml</exclude>
      <exclude>**/*.jpif</exclude>
      <exclude>**/*.properties</exclude>
      <exclude>**/*.txt</exclude>
    </excludes>
    <filtering>false</filtering>
  </resource>
</appResources> 


artifactIdToContextDir Map - Deprecated. use webapps in favor of this mapping to parameterize the contextpath via maven properties.
checkMergedVersions boolean 2.3 Whether to fail if two artifacts with the same artifactId but different version are retrieved to the applications lib dir. The check cannot detect classifier and will also fail on same version, same artifactId but different classifier.
Default value is: false.
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.
dos2unixPattern String[] 2.5 Filepattern to define the files for dos 2 unix line ending conversion.
encoding String - 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.
executables String[] 2.7 Lists all files that need the executable flag. All files listed here will be executable in the FS and in the ZIP. Default is
<executables>
 <executable>bin/cm</executable>
 <executable>bin/*.sh</executable>
 <executable>bin/bshrc</executable>
 <executable>bin/bshrc-scripting</executable>
 <executable>bin/bsh</executable>
</executables>

libDir String 2.4 The directory path relative to the configured outputDirectory, where jars should be retrieved to.
Default value is: lib.
outputDirectory File 2.0 Location of the assembled application.

Default value is: ${project.build.directory}/${project.build.finalName}.
overlays List 2.1 Similar to the war-plugin overlays you can define overlays here too. The syntax to define them is similar but you can only exclude/include files from direct dependencies and you cannot influence the order of extraction, which is fixed by the order the dependencies are listed in the pom, where files from the first listed dependency will win. This feature is still in beta phase and we might enrich the control overlays provide. To define an overlay simply add something like :
 <overlays>
   <overlay>
     <artifactId>foo</artifactId>
     <groupId>bar</groupId>
     <excludes>
       <exclude>forbidden.xml</exclude>
     </excludes>
   </overlay>
 </overlays>


stripJarVersions boolean 2.4 Strip artifact version during copying of jar artifacts
Default value is: false.
tomcatArtifactId String - Since the CoreMedia Tomcat has to be extracted in the tomcat subfolder of the application the package-inplace has to recognize the CoreMedia Tomcat artificat. This parameter defines the artifactId of the artifact.
tomcatGroupId String - Since the CoreMedia Tomcat has to be extracted in the tomcat subfolder of the application the package-inplace has to recognize the CoreMedia Tomcat artificat. This parameter defines the groupId of the artifact.
tomcatPath String - The CoreMedia Tomcat will be extracted into this directory within the application.
Default value is: tomcat.
webapps List 2.4 A list of webapp dependencies that should be deployed into the merged artifact. For each webapp entry you can define groupId,artifactId and the context under which the artifact should be deployed.

Parameter Details

appResources:

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

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

artifactIdToContextDir:

Deprecated. use webapps in favor of this mapping to parameterize the contextpath via maven properties.
A mapping from the wars artifactIds to their webapp context. An override configuration may look like:
 <artifactIdToContextDir>
   <some-war-artifactId>context-to-map-to</some-war-artifactId>
   <another-war-artifactId>another-context-to-map-to</another-war-artifactId>
 </artifactIdToContextDir>

Default value is: ${project.build.finalName} of the targeted war artifact.
  • Type: java.util.Map
  • Required: No

checkMergedVersions:

Whether to fail if two artifacts with the same artifactId but different version are retrieved to the applications lib dir. The check cannot detect classifier and will also fail on same version, same artifactId but different classifier.
  • Type: boolean
  • Since: 2.3
  • Required: No
  • Default: false

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

dos2unixPattern:

Filepattern to define the files for dos 2 unix line ending conversion.
  • Type: java.lang.String[]
  • Since: 2.5
  • Required: No

encoding:

The character encoding scheme to be applied when filtering the static application resources.
  • Type: java.lang.String
  • 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

executables:

Lists all files that need the executable flag. All files listed here will be executable in the FS and in the ZIP. Default is
<executables>
 <executable>bin/cm</executable>
 <executable>bin/*.sh</executable>
 <executable>bin/bshrc</executable>
 <executable>bin/bshrc-scripting</executable>
 <executable>bin/bsh</executable>
</executables>
  • Type: java.lang.String[]
  • Since: 2.7
  • Required: No

libDir:

The directory path relative to the configured outputDirectory, where jars should be retrieved to.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • Default: lib

outputDirectory:

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

overlays:

Similar to the war-plugin overlays you can define overlays here too. The syntax to define them is similar but you can only exclude/include files from direct dependencies and you cannot influence the order of extraction, which is fixed by the order the dependencies are listed in the pom, where files from the first listed dependency will win. This feature is still in beta phase and we might enrich the control overlays provide. 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

stripJarVersions:

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

tomcatArtifactId:

Since the CoreMedia Tomcat has to be extracted in the tomcat subfolder of the application the package-inplace has to recognize the CoreMedia Tomcat artificat. This parameter defines the artifactId of the artifact.
  • Type: java.lang.String
  • Required: No

tomcatGroupId:

Since the CoreMedia Tomcat has to be extracted in the tomcat subfolder of the application the package-inplace has to recognize the CoreMedia Tomcat artificat. This parameter defines the groupId of the artifact.
  • Type: java.lang.String
  • Required: No

tomcatPath:

The CoreMedia Tomcat will be extracted into this directory within the application.
  • Type: java.lang.String
  • Required: No
  • Default: tomcat

webapps:

A list of webapp dependencies that should be deployed into the merged artifact. For each webapp entry you can define groupId,artifactId and the context under which the artifact should be deployed.
  • Type: java.util.List
  • Since: 2.4
  • Required: No