The Maven SAR plugin is a simple Maven 1.x plugin that can be used to generate a JBoss SAR that you can deploy.

The plugin is available here and you can install is by dropping it into your Maven installations plugins directory using $MAVEN_HOME/plugins. It is also available from Service Mix CVS under tooling/maven-sar-plugin.

Short Term Solution

Note that this plugin was knocked up to work around a missing peice of functionality in the Maven JBoss plugin see http://jira.codehaus.org/browse/MPJBOSS-13

The plugin is purely for the packaging of the SAR, if you wish to generate your jboss-service.xml you should look at the XDoclet document. It requires a directory containing the META-INF/jboss-service.xml within your project, by default this is $basedir/src/sar, however it can be overridden with the property maven.sar.src=$basedir/src/sar.

You can also mark your dependencies so they are bundled using the sar.bundle property.

<dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.0.3</version>
   <url>http://jakarta.apache.org/commons/logging/</url>
   <properties>
       <sar.bundle>true</sar.bundle>
   </properties>
</dependency>

Once you have set this up, you can run the sar:install goal.

maven sar:install

If you project is usually myproject-1.0.jar you should now find a myproject-1.0.sar in your target directory which will hopefully deploy without a problem on JBoss.

  • No labels

1 Comment

  1. Unknown User (ruk)

    I've tried to use this plugin, however the problem appears.
    When I invoke goal sar:sar, it warn "target\classes not found."
    Why this plugin make sar file without compiling it?

    From my point of view, this plugin should have the same behaviour as jar plugin, but file must be deployed with type='sar' and with extension sar.