Developing with Flexmojos | Maven: The Complete Reference

Developing with Flexmojos

13.1. Introduction

This chapter provides an overview of the Flexmojos project for people interested in using Maven to develop Flex applications and libraries.

13.2. Configuring Build Environment for Flexmojos

<pluginGroups>  
    <pluginGroup>com.sonatype.maven.plugins</pluginGroup>  
    <pluginGroup>org.sonatype.plugins</pluginGroup>  
</pluginGroups>

13.3. Creating a Flex Mojos Project from an Archetype

Flexmojos has a set of archetypes which can be used to quickly create a new Flex project. The following archetypes are all in the org.sonatype.flexmojos group with a version of ${flexmojos.version}:

13.3.1. Creating a Flex Library

To create a Flex Library Project, execute the following command:

$ mvn archetype:generate \
  -DarchetypeRepository=http://repository.sonatype.org/content/groups/public\
  -DarchetypeGroupId=org.sonatype.flexmojos \
  -DarchetypeArtifactId=flexmojos-archetypes-library \
  -DarchetypeVersion=${flexmojos.version}

13.3.2. Creating a Flex Application

To create a Flex application from a Maven archetype, execute the following command:

$ mvn archetype:generate \
      -DarchetypeRepository=http://repository.sonatype.org/content/groups/public\
      -DarchetypeGroupId=org.sonatype.flexmojos \
      -DarchetypeArtifactId=flexmojos-archetypes-application \
      -DarchetypeVersion=${flexmojos.version}

13.3.3. Creating a Multi-module Project: Web Application with a Flex

To create a multi-module project consisting of a Flex Library project referenced by a Flex Application, referenced by a Web Application:

$ mvn archetype:generate \
      -DarchetypeRepository=http://repository.sonatype.org/content/groups/public\
      -DarchetypeGroupId=org.sonatype.flexmojos \
      -DarchetypeArtifactId=flexmojos-archetypes-modular-webapp \
      -DarchetypeVersion=${flexmojos.version}

13.4. The FlexMojos Lifecycle

The FlexMojos Maven plugin customizes the lifecycle based on the packaging. If your project has a packaging of type swc or swf, the FlexMojos plugin with execute a customized lifecycle if your plugin configuration sets the extensions to true.

13.5. FlexMojos Plugin Goals

The FlexMojos Maven Plugin contains several goals:

13.6. FlexMojos Plugin Reports

The FlexMojos Maven Plugin contains the flexmojos:asdoc-report which generates documentation for Actionscript sources as a report that can be included in a Maven site.

13.7. Developing and Customizing Flexmojos

Flexmojos is an open-source project hosted on the Sonatype Forge, and the source code for Flexmojos can be accessed within their repository.