Maven2 AAR Plug-in Guide

Introduction

This plugin generates an Axis 2 service file (AAR file).

[Download Plugin Tool]

Goals

The AAR plugin allows the packaging of an Axis 2 service aar in 3 different modes:

  1. aar (default): generates the aar artifact
  2. inplace : package the aar in the source tree
  3. exploded : package an exploded aar application

Each mode is materialized by a goal. For instance, to generate an exploded aar from the current project, one would type

mvn aar:exploded

Configuration

All AAR plugin goals takes the following configuration parameters as input:

Parameter NameDefault ValueDescription
aarDirectory${project.build.directory}/aarDirectory where the aar file is built
classesDirectory${project.build.outputDirectory}Directory with compiled classes and resources
fileSetsAdditional file sets, which are being added to the archive. See "File Sets" below for an example
servicesXmlFileLocation of the services.xml file. By default, it is assumed that the file is already present in classesDirectory/META-INF and no special processing is required
wsdlFileLocation of the WSDL file. By default, it is assumed that the file is already present in classesDirectory/META-INF and no special processing is required
wsdlFileNameservice.wsdlName, to which the WSDL file should be mapped

The aar Goal

The aar goal allows the following additional parameters:

Parameter NameDefault ValueDescription
outputDirectory${project.build.directory}Directory where to generate the AAR file
aarName${project.build.finalName}The generated AAR files name
archiveA Maven archive configuration. This allows, for example, to configure the MANIFEST.MF file
classifierA classifier, which should be added to the generated AAR files name. Setting this parameter has the side effect, that the artifact is treated as an attachment and not as the projects primary artifact
primaryArtifacttrueSetting this property to false disables installation or deployment of the artifact as the projects primary artifact

File Sets

Additional file sets may be configured for inclusion into the AAR file. A file set looks as follows:

  
  <fileSets>
    <fileSet>
      <directory>src/aar/files</directory>
      <outputDirectory>META-INF/docs</outputDirectory>
      <includes>
        <include>**/*.html</include>

      </includes>
    </fileSet>
    <fileSet>
      <directory>src/aar/files</directory>
      <outputDirectory>META-INF/etc</outputDirectory>

      <excludes>
        <exclude>**/*.html</exclude>
      </excludes>
    </fileSet>
  </fileSets>
  

The example specifies, that the contents of the directory src/aar/files shall be added to the AAR file. HTML files will go into META-INF/docs, all other files to META-INF/etc.

A file set is configured through the following configuration parameters:

Parameter NameDescription
directoryThe directory, from which to read the file set. This parameter is required
outputDirectoryThe target directory within the AAR file. Defaults to the AAR files root directory
includesConfigures the set of files, which shall be included into the AAR file. Defaults to **/*
excludesConfigures a set of files, which shall be excluded from the file set. Defaults to the Maven default excludes (**/*~, **/cvs/**/*, **/.svn/**/*, etc.)
skipDefaultExcludesIf this parameter is set to true, then no default excludes are being used