Blueprint Developer Manual / Version 2412.0
Table Of Contents
By default, Maven provides you with several packaging types. The most
important ones are the pom
, jar
and the war
type. They
should be sufficient for the most common kinds of development modules but whenever you try to
either support proprietary formats or try to break whole new ground, those three packaging types
aren't sufficient. Using only the pom
packaging type together with custom
executions of arbitrary plugins, gives you flexibility but adding and maintaining your
pom.xml
files is going to be a complex and costly process.
To reduce complexity, but even more important to enforce standards, CoreMedia came up with a
custom tailored packaging type for the CoreMedia Blueprint workspace.
The coremedia-application
packaging type
provides a build lifecycle and dependency profile for a proprietary application format.
coremedia-application
The coremedia-application
packaging type is provided by the
coremedia-application-maven-plugin
. When you take a look at the root
pom.xml
file and search for this plugin, you will find two occurrences, one in
the pluginManagement
section and one in the build
section. The
latter definition contains the line <extensions>true</extensions>
within its plugin body, telling Maven that it extends
Maven functionality. In this case, Maven
will register the custom lifecycle bound to the custom packaging type.
<plugin> <groupId>com.coremedia.maven</groupId> <artifactId>coremedia-application-maven-plugin</artifactId> <extensions>true</extensions> </plugin>
Besides lifecycle, a custom packaging type can also influence if
Maven dependencies of this type have transitive dependencies or
not. Because CoreMedia wanted to keep the coremedia-application
packaging type to
be the pendant of the war
packaging type, it does not have transitive
dependencies either. For your modules to depend on other coremedia-application
modules and their dependencies as well, this means, that you need to define an additional
dependency to the same GAV (groupId, artifactId, version) coordinates but with packaging type
pom
.
<dependency> <groupId>com.coremedia.cms</groupId> <artifactId>application</artifactId> <type>coremedia-application</type> <scope>runtime</scope> </dependency> <dependency> <groupId>com.coremedia.cms</groupId> <artifactId>application</artifactId> <type>pom</type> <scope>runtime</scope> </dependency>
Example 4.1. Dependencies for a CoreMedia application
You may know this pattern from working with war
overlays if they are skinny too, which
means that they contain no further versioned artifacts.
For further information about the coremedia-application-maven-plugin
, you should
visit the plugins documentation site at
CoreMedia
Application Plugin.