coremedia-application:rpm

Full name:

com.coremedia.maven:coremedia-application-maven-plugin:2.7.9:rpm

Description:

The RpmMojo provides easy capabilities to package your applications as rpm native packages. By using the great redline-rpm library, the plugin can build rpms even on windows machines. The Mojo comes with three inbuilt preconfigured rpm configurations:
  • The default configuration packages everything below the ${outputDirectory} which is by default set to ${project.build.directory}/${project.build.finalName}
  • The coremedia-tomcat configuration packages a default tomcat layout but additionally sets execution flags to the bin directory and creates symlinks to /var/tmp/coremedia/[rmpConfig.name|artifactId] for the temp dir and a symlink /var/log/coremedia/[rmpconfig.name|artifactId] for the logs directory. The conf directory will be created using the rpm configuration directive.
  • The coremedia-application configuration packages a default coremedia-application layout but additionally sets execution flags to the bin directory and creates symlinks to /var/tmp/coremedia/[rmpconfig.name|artifactId] for the var/tmp dir and a symlink /var/log/coremedia/[rmpConfig.name|artifactId] for the var/logs directory. The config and the properties directories will be created using the rpm configuration directive.

Defaults for rpmConfig

  • [rpmConfig.name] to ${project.artifactId}
  • [rpmConfig.group to "Unspecified"
  • [rpmConfig.version] to "${project.version}"
  • [rpmConfig.release] to see extra explanation below
  • [rpmConfig.host] to the ip of the build machine if it can be determined
  • [rpmConfig.packager] to the java systemproperty "user.name"
  • [rpmConfig.type] to BINARY
  • [rpmConfig.architecture] to NOARCH
  • [rpmConfig.os] to LINUX
  • [rpmConfig.targetRoot] to /opt/coremedia
  • [rpmConfig.defaultuser] to "coremedia"
  • [rpmConfig.defaultgroup] to "coremedia"
  • [rpmConfig.defaultfilemode] to "0644"
  • [rpmConfig.defaultdirmode] to "0755"


Defaults for rpmConfig.release

Since the versioning scheme of rpm artifacts does not have a "SNAPSHOT" syntax and therefore requires an incremental integer, we have to handle a reasonable default it with more care.

  • In case of a SNAPSHOT version of ${project.version} we use the start time of the maven build in unixtime. In combination with the rpm version attributio set to ${project.version} (with SNAPSHOT suffix) we can guarantee a rpm update to take the most recent rpm.
  • In case of a release by default a 1 is used as the first release version. If however you have set a version with a number as a qualifier this number will be used for release, e.g. project.version=1.2-2 will lead to a rpm.version=1.2 and a rpm.release=2.


Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.4.
  • Binds by default to the lifecycle phase: package.

Optional Parameters

Name Type Since Description
classifier String 2.4 The classifier used for installing or deploying the created artifact
outputDirectory File 2.0 Location of the assembled application.

Default value is: ${project.build.directory}/${project.build.finalName}.
outputFile File 2.4 The path of the archive to be created. The default value will be ${project.build.directory}/${project.build.finalName}.[zip|war|rpm]
rpmConfig RpmConfig 2.4 The main configuration for the rpm goal. The following snippet shows an example configuration with one mapping and one symlink. If an element contains a "|" character it means that this element can be left empty in which case a default value will be applied.
 <rpmConfig>
   <name>${project.artifactId}</name>
   <group>Unspecified</group>
   <version>${project.version}</version>
   <release>see extra explanation </release> ##see extra explanation below
   <url>${project.organisation.url}</url>
   <vendor>${project.organisation.name}</vendor>
   <host>the hostname of your machine if set</host>
   <packager>${user.name}</packager>
   <type>BINARY</type>
   <architecture>NOARCH</architecture>
   <os>LINUX</os>
   <targetRoot>/opt/coremedia</targetRoot>
   <defaultuser>root</defaultuser>
   <defaultgroup>root</defaultgroup>
   <defaultfilemode>644</defaultfilemode>
   <defaultdirmode>755</defaultdirmode>
   <createEmptyDirs>false</createEmptyDirs>
     <mapping>
       <directory>bin/service</directory>
        <includes>**/*</includes>
        <excludes>private/**</exludes>
       <prefix>/etc/init.d/</prefix>
       <dirmode>755 | [rpmConfig.defaultdirmode]</filemode>
       <filemode>644 | [rpmConfig.defaultfilemode]</filemode>
       <groupname>coremedia | [rpmConfig.defaultgroup]</groupname>
       <username>coremedia | [rpmConfig.defaultuser]</username>
       <directive>[NONE | CONFIG | DOC | ICON | MISSINGOK | NOREPLACE | SPECFILE | GHOST | LICENSE | README | EXCLUDE | UNPATCHED | PUBKEY | POLICY]<directive>
     </mapping>
   </mappings>
   <symlinks>
     <symlink>
       <source>/var/log/coremedia/${project.artifactId}</source>
       <target>var/logs</target>
       <permissions>"644" | [rpmConfig.defaultfilemode]</permissions>
     </symlink>
   </symlinks>
   <dependencies>
     <dependency>
       <packageName>ksh</packageName>
       <minVersion>1211323</minVersion>
     </dependency>
     <dependency>
       <packageName>httpd</packageName>
       <maxVersion>2.2.20</maxVersion>
     </dependency>
   </dependencies>
   <preInstallScript>PATH TO SCRIPT</preInstallScript>
   <postInstallScript>PATH TO SCRIPT</postInstallScript>
   <preUninstallScript>PATH TO SCRIPT</preUninstallScript>
   <postUninstallScript>PATH TO SCRIPT</postUninstallScript>
 </rpmConfig>

For all possible directives and their interpretations visit rpm.org


skipArchiving boolean 2.4 Skips the archive creation.
Default value is: false.
skipRpmArchiving boolean 2.7 Skips the archive creation.
Default value is: false.
User property is: skipRpmArchiving.

Parameter Details

classifier:

The classifier used for installing or deploying the created artifact
  • Type: java.lang.String
  • Since: 2.4
  • Required: No

outputDirectory:

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

outputFile:

The path of the archive to be created. The default value will be ${project.build.directory}/${project.build.finalName}.[zip|war|rpm]
  • Type: java.io.File
  • Since: 2.4
  • Required: No

rpmConfig:

The main configuration for the rpm goal. The following snippet shows an example configuration with one mapping and one symlink. If an element contains a "|" character it means that this element can be left empty in which case a default value will be applied.
 <rpmConfig>
   <name>${project.artifactId}</name>
   <group>Unspecified</group>
   <version>${project.version}</version>
   <release>see extra explanation </release> ##see extra explanation below
   <url>${project.organisation.url}</url>
   <vendor>${project.organisation.name}</vendor>
   <host>the hostname of your machine if set</host>
   <packager>${user.name}</packager>
   <type>BINARY</type>
   <architecture>NOARCH</architecture>
   <os>LINUX</os>
   <targetRoot>/opt/coremedia</targetRoot>
   <defaultuser>root</defaultuser>
   <defaultgroup>root</defaultgroup>
   <defaultfilemode>644</defaultfilemode>
   <defaultdirmode>755</defaultdirmode>
   <createEmptyDirs>false</createEmptyDirs>
     <mapping>
       <directory>bin/service</directory>
        <includes>**/*</includes>
        <excludes>private/**</exludes>
       <prefix>/etc/init.d/</prefix>
       <dirmode>755 | [rpmConfig.defaultdirmode]</filemode>
       <filemode>644 | [rpmConfig.defaultfilemode]</filemode>
       <groupname>coremedia | [rpmConfig.defaultgroup]</groupname>
       <username>coremedia | [rpmConfig.defaultuser]</username>
       <directive>[NONE | CONFIG | DOC | ICON | MISSINGOK | NOREPLACE | SPECFILE | GHOST | LICENSE | README | EXCLUDE | UNPATCHED | PUBKEY | POLICY]<directive>
     </mapping>
   </mappings>
   <symlinks>
     <symlink>
       <source>/var/log/coremedia/${project.artifactId}</source>
       <target>var/logs</target>
       <permissions>"644" | [rpmConfig.defaultfilemode]</permissions>
     </symlink>
   </symlinks>
   <dependencies>
     <dependency>
       <packageName>ksh</packageName>
       <minVersion>1211323</minVersion>
     </dependency>
     <dependency>
       <packageName>httpd</packageName>
       <maxVersion>2.2.20</maxVersion>
     </dependency>
   </dependencies>
   <preInstallScript>PATH TO SCRIPT</preInstallScript>
   <postInstallScript>PATH TO SCRIPT</postInstallScript>
   <preUninstallScript>PATH TO SCRIPT</preUninstallScript>
   <postUninstallScript>PATH TO SCRIPT</postUninstallScript>
 </rpmConfig>

For all possible directives and their interpretations visit rpm.org

  • Type: com.coremedia.cms.maven.application.rpm.RpmConfig
  • Since: 2.4
  • Required: No

skipArchiving:

Skips the archive creation.
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: false

skipRpmArchiving:

Skips the archive creation.
  • Type: boolean
  • Since: 2.7
  • Required: No
  • User Property: skipRpmArchiving
  • Default: false