Print
Maven Loom usage

Introduction

The maven-loom plug-in provides the ability to generate a Loom application packaged as a Sar file, install it and deploy it.

Plug-in Goals

Name Description
loom Defaults to loom:sar
loom:init Initialize the file system and define tasks
loom:sar Build a sar file
loom:install Install the sar in the local repository
loom:metagenerate Metagenerate Loom descriptors
loom:install Install the sar in the local repository
loom:install-snapshot Install snapshot of the sar in the local repository
loom:deploy Deploy the sar to the remote repository
loom:deploy-snapshot Deploy snapshot of the sar to the remote repository

Plug-in Settings

Property Optional Description
maven.loom.src Yes Location of source in source tree. Defaults to ${maven.src.dir}
maven.loom.assembly Yes Location of the assembly.xml file. Defaults to ${maven.loom.src}/conf/assembly.xml.
maven.loom.config Yes Location of the config.xml file. Defaults to ${maven.loom.src}/conf/config.xml.
maven.loom.environment Yes Location of the environment.xml file. Defaults to ${maven.loom.src}/conf/environment.xml.
maven.loom.logging Yes Location of the logging configuration file which can be specified in alternative to the logs element in environment.xml (which takes precedence over the logging configuration). The recognised valid logging file names are: log4j.properties, log4j.xml, logging.properties, excalibur-logger.xml. Has no default.
maven.loom.build.dir Yes Directory where the sar will be generated. Defaults to ${maven.build.dir}.
maven.loom.lib.include Yes Build artifacts to include in sar. Defaults to ${pom.artifactId}*.jar. Files are relative to ${maven.loom.build.dir}.
maven.loom.lib.exclude Yes Build artifacts to exclude in sar. Defaults to none. Files are relative to ${maven.loom.build.dir}.

Including jars in the sar

To include a dependency in the sar you need to set the sar.bundle property to true:

<dependency>
  <id>jarid</id>
  <version>jarversion</version>
  <properties>
    <sar.bundle>true</sar.bundle>
  </properties>
</dependency>

Including resources in the app

To include a resource in the app you need to set the corresponding targetPath to SAR-INF.

Example:

<build>
  <resources>
    <resource>
      <directory>${basedir}/src/conf</directory>
      <targetPath>SAR-INF</targetPath>
      <includes>
        <include>**/somedescriptor.xml</include>
      </includes>
      <excludes>
        <exclude>**/*.java</exclude>
      </excludes>
    </resource>
  </resources>
</build>

Tips

Filtering XML files

If you need to copy the [assembly|config|environment].xml files in order to replace some filter tokens or simply perform some custom modification to it, simply write a pre-goal to the loom:sar goal in which you perform the manipulation. Then set the maven.loom.[assembly|config|environment] property to point to your modified [assembly|config|environment].xml.

Powered by Atlassian Confluence