Maven: The Complete Reference

13.5. FlexMojos Plugin Goals

The FlexMojos Maven Plugin contains the following goals:

Generates documentation for Actionscript source files
Generates documentation for Actionscript sources as a report that can be included in a Maven site
Compiles Flex source (Actionscript and MXML) into a SWC library for use in a Flex or AIR application
Compiles Flex source (Actionscript and MXML) into a SWF for use in the Adobe Flash Player or Adobe AIR Runtime
Copies Flex resources into a web application project
Generates project files for use in Adobe Flex Builder
Generates Actionscript 3 based on Java classes using Granite GAS3
Goal which run post-link SWF optimization on swc files. This goal is used to produce RSL files.
Create a JAR which contains all the sources for a Flex project
Compile all test classes in a Flex project
Run the tests using the Adobe Flash Player
Build a SWC containing the test classes for a specific project
Generate an HTML wrapper for a SWF application

13.5.1. Generating Actionscript Documentation

You can run the asdoc or asdoc-report goals to generate documentation for Actionscript. Once the goals has completed, the documentation will be saved to ${basedir}/target/asdoc as HTML. Figure 13.9, “Actionscript Documentation Generated by the FlexMojos Plugin” shows the result of running the asdoc goal against the Flexmojos application archetype project.


Figure 13.9. Actionscript Documentation Generated by the FlexMojos Plugin

13.5.2. Compiling Flex Source

FlexMojos contains a number of goals which compile Actionscript and MXML into SWCs and SWFs. The compile-swc and compile-swf goals are used to generate output from a project’s source, and test-compile is used to compile unit tests. In the simple projects created by the FlexMojos archetypes, the compile-swc and compile-swf goals are called because the project customizes the lifecycle and binds either compile-swc or compile-swf to the compile phase and test-compile to the test-compile phase. If you need to configure the options for the FlexMojos compiler, you would configure the FlexMojos plugin configuration. For example, if you wanted the application with the POM shown in POM for Flex Application Archetype to ignore certain code-level warnings on compile and use some customized font settings, you might use the plugin configuration shown in Customizing the Compiler Plugin.

Customizing the Compiler Plugin. 


13.5.3. Generating Flex Builder Project Files

To generate Flex Builder project files for a FlexMojos project, configure the plugin groups as described in Section 13.2.4, “Adding FlexMojos to Your Maven Settings' Plugin Groups”, and run the flexbuilder goal:

$ mvn flexmojos:flexbuilder

Running this goal will create a .project, .settings/org.eclipse.core.resources.prefs, .actionScriptProperties, and .flexLibProperties.