Plugin Documentation

Goals available for this plugin:

Goal Description
nar:help Display help information on maven-nar-plugin.
Call
 mvn nar:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details.
nar:nar-assembly Assemble libraries of NAR files.
nar:nar-compile Compiles native source files.
nar:nar-download Downloads any dependent NAR files. This includes the noarch and aol type NAR files.
nar:nar-gnu-configure Copies the GNU style source files to a target area, autogens and configures them.
nar:nar-gnu-make Runs make on the GNU style generated Makefile
nar:nar-gnu-process Move the GNU style output in the correct directories for nar-package
nar:nar-gnu-resources Move the GNU style include/lib to some output directory
nar:nar-integration-test Run integration tests using Surefire. This goal was copied from Maven's surefire plugin to accomodate a few things for the NAR plugin:

1. To test a jar file with its native module we can only run after the package phase, so we use the integration-test phase.

2. We need to set java.library.path to an AOL (architecture-os-linker) specific value, but AOL is only known in the NAR plugin and thus cannot be set from the pom.

3. To have the java.library.path definition picked up by java we need the "pertest" forkmode. To use this goal you need to put the test sources in the regular test directories but disable the running of the tests by the maven-surefire-plugin by setting maven.test.skip.exec to false in your pom.

nar:nar-javah Compiles class files into c/c++ headers using "javah". Any class file that contains methods that were declared "native" will be run through javah.
nar:nar-package Jars up the NAR files.
nar:nar-resources Copies any resources, including AOL specific distributions, to the target area for packaging
nar:nar-system-generate Generates a NarSystem class with static methods to use inside the java part of the library. Runs in generate-resources rather than generate-sources to allow the maven-swig-plugin (which runs in generate-sources) to configure the nar plugin and to let it generate a proper system file.
nar:nar-test Tests NAR files. Runs Native Tests and executables if produced.
nar:nar-testCompile Compiles native test source files.
nar:nar-unpack Unpacks NAR files. Unpacking happens in the local repository, and also sets flags on binaries and corrects static libraries.
nar:nar-validate Validates the configuration of the NAR project (aol and pom)

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 2.0.9
JDK 1.4
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-nar-plugin</artifactId>
          <version>2.1-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-nar-plugin</artifactId>
        <version>2.1-SNAPSHOT</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"