Maven AAR Plugin 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, and the deployment of the result:

  1. aar: generates the aar artifact
  2. inplace : package the aar in the source tree
  3. exploded : package an exploded aar application
  4. deployaar : deploy the aar to a running Axis2 server through its administration console (parameters axis2AdminConsoleURL, default http://localhost:8080/axis2/axis2-admin, axis2AdminUser and axis2AdminPassword)

Each mode is materialized by a goal. The plugin's goal prefix is axis2, which it shares with the other Axis2 plugins (the MAR plugin has goals with the same names), so invoke the goals with the full plugin coordinates. For instance, to generate an exploded aar from the current project, one would type

mvn org.apache.axis2:axis2-aar-maven-plugin:exploded

Configuration

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

Parameter Name Default Value Description
aarDirectory ${project.build.directory}/aar Directory where the aar file is built
classesDirectory ${project.build.outputDirectory} Directory with compiled classes and resources
fileSets Additional file sets, which are being added to the archive. See "File Sets" below for an example
servicesXmlFile src/main/resources/META-INF/services.xml Location of the services.xml file. If it is present at the default location it is included automatically; otherwise this parameter must be set
includeDependencies true Whether the dependency jars should be included in the aar
wsdlFile Location of the WSDL file, if any. By default, no WSDL file is added and it is assumed that Axis2 will automatically generate a WSDL file
wsdlFileName service.wsdl Name, to which the WSDL file should be mapped

The aar Goal

The aar goal allows the following additional parameters:

Parameter Name Default Value Description
outputDirectory ${project.build.directory} Directory where to generate the AAR file
aarName ${project.build.finalName} The generated AAR files name
archive A Maven archive configuration. This allows, for example, to configure the MANIFEST.MF file
classifier A 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
primaryArtifact true Setting 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 Name Description
directory The directory, from which to read the file set. This parameter is required
outputDirectory The target directory within the AAR file. Defaults to the AAR files root directory
includes Configures the set of files, which shall be included into the AAR file. Defaults to **/*
excludes Configures a set of files, which shall be excluded from the file set. Defaults to the Maven default excludes (**/*~, **/cvs/**/*, **/.svn/**/*, etc.)
skipDefaultExcludes If this parameter is set to true, then no default excludes are being used