Maven: The Complete Reference
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. Setting Plugin Extensions to True for Custom Flex Lifecycle shows the plugin configuration
for the flexmojos-maven-plugin with the extensions set to true.
Setting Plugin Extensions to True for Custom Flex Lifecycle.
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
*<extensions>true</extensions>*
<configuration>
<locales>
<locale>en_US</locale>
</locales>
</configuration>
</plugin>
</plugins>
</build>
When the packaging is swc, FlexMojos will execute the lifecycle shown in Figure 13.7, “The FlexMojos SWC Lifecycle”. The highlighted goals are goals from the FlexMojos plugin, the goals which are not highlights are standard goals from the Core Maven plugins.
The FlexMojos contributed goals are:
- flexmojos:compile-swc
-
This goal compiles all of the Actionscript and MXML files in the
sourceDirectoryinto a SWC. A SWC is an Adobe library or class file which contains components and resources used in Flex applications. - flexmojos:test-compile
-
This goal compiles all of the Actionscript and MXML files in the
testSourceDirectory. - flexmojos:test-run
- This goal executes unit tests using the Flash Player. This goal can only run if the Flash Player has been configured as described in Section 13.2.3, “Configuring Environment to Support Flex Unit Tests”.
When the packaging is swf, FlexMojos will execute the lifecycle shown in Figure 13.8, “The FlexMojos SWF Lifecycle”. The highlighted goals are goals from the FlexMojos plugin, the goals which are not highlights are standard goals from the Core Maven plugins.
The FlexMojos contributed goals are:
- flexmojos:compile-swf
-
This goal compiles all of the Actionscript and MXML files in the
sourceDirectoryinto a SWF. A SWF is a file which contains an application that can be render by the Adobe Flash Player or Adobe AIR software. - flexmojos:test-compile
-
This goal compiles all of the Actionscript and MXML files in the
testSourceDirectory. - flexmojos:test-run
- This goal executes unit tests using the Flash Player. This goal can only run if the Flash Player has been configured as described in Section 13.2.3, “Configuring Environment to Support Flex Unit Tests”.
