Avalon Plugin for Maven

Meta Generation

The Avalon Plugin for Maven provides support for developers in the management of Maven based projects that leverage the Avalon component model. This plugin will be progressively extended with Avalon and related sub-system utilities. Currently the plugin provides support for a meta info generation process based on javadoc tags within class and interface source files.

Goals

Goal Description
avalon:meta

Generates meta info descriptors for service and component types based on javadoc tags within the java source files. Source class files are scanned for the presence of an @avalon.component or @avalon service tag and if present, a meta descriptor is generated.

Meta info generation process includes:

  • Scan source files for avalon.type or @avalon.service tags
  • Build Type and Service descriptors
  • Externalize descriptors to serial or xml format

Resulting meta info descriptors are placed int the ${basedir}/target/src directory. Typical application scenario is to define a preGoal to handle meta-info generation under the maven.xml file and inclusion of the output meta info under the project.xml jar resources.

maven.xml example

  <project default="jar:jar">
    <preGoal name="jar:jar">
      <attainGoal name="avalon:meta"/>
    </preGoal>
  </project>

project.xml example

  <project>
    <!-- other stuff -->
    <build>
      <!-- more stuff -->
      <resources>
        <!-- include the generated meta-info descriptors into you jar file -->
        <resource>
          <directory>${basedir}/target/src</directory> 
          <includes>
            <include>**/*.x*</include> <!-- meta info desriptors -->
          </includes>
        </resource>
      </resources>
    </build>
  </project>

Properties

Property name Optional? Description
avalon.meta.format Yes

Output format specification. Valid values include 'xml' or 'serial'. The xml value instructs the meta generator to create meta descriptions in an XML format whereas the 'serial' value generates a serialized description of the descriptor. Serial format is more efficient. The XML format is more portable.

Default behaviour:

avalon.meta.format="xml"
avalon.meta.force Yes

Policy controlling the regeneration of meta descriptors independently of the descriptor data. This value default to false.

Default behaviour:

avalon.meta.force="false"
avalon.meta.type.postfix No

Avalon will default to the generation of XML type descriptors under the .xinfo file type. When generating meta-info descriptors targetted for deployment in both Merlin and Phoenix, the xinfo type will conflict with the Phoenix meta-info descriptor. Avalon Plugin provides support for generation of meta info under the alternative .xtype. To control the type of file generated, you can declare either "xinfo" or "xtype" under this property.

Default behaviour:

avalon.meta.type.postfix="xinfo"

Alternative xtype behaviour:

avalon.meta.type.postfix="xtype"