Overview

The Maven JSTools Plugin is used both as a reporting plugin in your JS project POM and a normal dependency in your web application POM. For Maven to resolve the plugin, you may have to install it in your local repository if it is not in the central Maven repo yet.

Manual Install

First you need to download the plugin JAR file, and POM then install the JAR with the following command in a single line (replace ${project.version} with the actual plugin version):

mvn install:install-file -DgroupId=gr.abiss.mvn.plugins -DartifactId=maven-jstools-plugin 
 -Dversion=${project.version} -Dpackaging=maven-plugin -Dfile=/path/to/jar/file

You will also need to manually place the POM you downloaded in your repo, for example in unix-style systems you could run the following command in one line:

cp /path/to/maven-jstools-plugin-${project.version}.pom 
 ~/.m2/repository/gr/abiss/mvn/plugins/maven-jstools-plugin/${project.version}/maven-jstools-plugin-${project.version}.pom
          

Use as a Reporting Plugin

To use the Maven JSTools Plugin for reporting in your JS project, simply add it in the reporting section of your POM:

<reporting>
   <plugins>
      <!-- ... -->
      <plugin>
         <groupId>gr.abiss.mvn.plugins</groupId>
         <artifactId>maven-jstools-plugin</artifactId>
         <inherited>false</inherited>
         <configuration>
            <!-- the default is src/main/js -->
            <jsDir>${project.build.directory}/site/sarissa</jsDir>
            <!-- this is actually the default -->
            <includes>**/*.js</includes>
            <!-- maybe you need to exclude compressed JS files -->
            <excludes>**/*-compressed.js</excludes>
            <!-- this is actually the default -->
            <caseSensitive>true</caseSensitive>
            <!-- for more configuration properties, see the goals documentation -->
         </configuration>
         <reportSets>
            <reportSet>
               <reports>
                  <!-- include the desired reports -->
                  <report>jslint</report>
                  <report>jsdoc</report>
               </reports>
            </reportSet>
         </reportSets>
      </plugin>
      <!-- ... -->
   </plugins>
</reporting>
            

Use as a Dependency in your Webapp

To use the Maven JSTools Plugin for runtime discovery of JS files or other static resources from JS package dependencies (see howto on that), simply add the plugin as a normal dependency in your WAR's POM as shown below, then follow the JS packaging HOWTO .

<dependencies>
   <!-- ... -->
   <dependency>
      <groupId>gr.abiss.mvn.plugins</groupId>
      <artifactId>maven-jstools-plugin</artifactId>
      <version>0.6</version>
      <exclusions>
        <exclusion>
          <!-- rhino is only needed for reporting, not WAR runtime -->
          <groupId>rhino</groupId>
          <artifactId>js</artifactId>
        </exclusion>
      </exclusions> 
   </dependency>
   <!-- ... -->
</dependencies>
            

Configuration

For use in your Javascript project, see the configuration options of plugin goals documentation . For using the plugin as a dependency to serve JS dependencies in your WAR project follow the JS packaging HOWTO .