link
Avalon
Avalon Central
Home PlanetProductsCentral
Merlin Plugin for Maven
Meta Generation

The Merlin 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 Merlin 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
GoalDescription
merlin:meta

Generates meta info descriptors for service and component types based on javadoc tags within the java source files. Source files are scanned for the presence of an @avalon.version tag and if present, a meta descriptor is generated. If the version tag is within an interface defintion, a new Service defintion is created otherwise a Type defintion is created.

Meta info generation process includes:

  • Scan source files for avalon.meta 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="merlin:meta"/>
    </preGoal>
  </project>

project.xml example

  <project>
    <!-- other stuff -->
    <build>
      <!-- more stuff -->
      <resources>
        <!-- include the generated metainfo descriptors into you jar file -->
        <resource>
          <directory>${basedir}/target/src</directory> 
          <includes>
            <include>**/*.x*</include>
          </includes>
        </resource>
      </resources>
    </build>
  </project>
Properties
Property name Optional? Description
merlin.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:

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

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

Default behaviour:

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

Merlin will default to the deneration 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. Merlin 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:

merlin.meta.type.postfix="xinfo"

Alternative xtype behaviour:

merlin.meta.type.postfix="xtype"