Migrating to 6.x
Generating FDKs
First of all, you have to checkout the Sources fromÂ
https://svn.apache.org/repos/asf/flex/utilities/trunk/mavenizer/
Building it is as simple as:
mvn clean install
The tool is able to mavenize any Flex or Air SDK. It expects the downloaded SDKs to be provided in the following structure:
{source-dir} {source-dir}/air/ {source-dir}/air/{air-sdk-dir-1} {source-dir}/air/{air-sdk-dir-2} {source-dir}/air/{air-sdk-dir-3} {source-dir}/flex/ {source-dir}/flex/{flex-sdk-dir-1} {source-dir}/flex/{flex-sdk-dir-2} {source-dir}/flex/{flex-sdk-dir-3} {source-dir}/flex/{flex-sdk-dir-4}
The naming of the individual sdks directories is irelevant, but the names are used to control the order in which the SDKs are processed. Air SDKs are processed before the Flex SDKs.
java SDKGenerator {source-directory} {target-directory} false
This will take all the SDKs in the source directory and output them in a mavenized form to the output directory. The last parameter is used to force the generator to generate the Apache FDKs using the group-id "com.adobe.flex" instead of the obviously correct "org.apache.flex" group-id. The content of the target-directory simply needs to be copied to the local maven repository.Â
Updating your POMs
Specifying the Flash version
The mavenizer generates air and flex artifacts separate from the flex artifacts. In the olf FDK structure you had to specify the flashplayer using a classifier:Â
<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>playerglobal</artifactId> <version>3.4.0.9271</version> <classifier>10</classifier> <type>swc</type> </dependency>
This is now done this way:Â
<dependency> <groupId>com.adobe.flash.framework</groupId> <artifactId>playerglobal</artifactId> <version>10.0</version> <type>swc</type> </dependency>Â
Please note that the version of the Flashplayer artifacts all have two segment versions and that the GroupId is com.adobe.flash.framework.
Specifying the Air version
The Flex SDK comes with a bundled Air SDK. The libs of the SDK are accompanied with special Flex AIR libs. The Mavenizer generated the SDK libs to the group-id "com.adobe.air.framework" and the Flex-Air libs to "com.adobe.flex.framework.air". This makes configuring the dependencies for Air application a little more complicated, but allows to select the target Air SDK version separately from the version of Flex SDK. This should make it easier to use new Air SDK versions that were not yet bundled with a Flex SDK.
<build> <sourceDirectory>src/main/flex</sourceDirectory> <plugins> <plugin> <groupId>net.flexmojos.oss</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>6.0.0</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex.version}</version> <type>pom</type> </dependency> <dependency> <groupId>com.adobe.air</groupId> <artifactId>compiler</artifactId> <version>${air.version}</version> <type>pom</type> </dependency> </dependencies> </plugin> </plugins> </build> ... Â <dependency> <groupId>com.adobe.air.framework</groupId> <artifactId>common-framework</artifactId> <version>${air.version}</version> <type>pom</type> </dependency> <dependency> <groupId>com.adobe.flex.framework.air</groupId> <artifactId>air-framework</artifactId> <version>${flex.version}</version> <type>pom</type> </dependency>
The dependency to the air compiler artifact is only needed if you are creating an Air application (Packaging "air")
Themes
Prior to the Mavenized SDKs the theme artifacts were provided in different ways. Some were simple CSS files, some CSS with resources and some were available as compiled Libraries. When executing, the Mavenizer now compiles any non-library themes to libraries and all Themes are now available the exatyl same way.Â
However the Group-Id has been changed from "com.adobe.flex.framework" to "com.adobe.flex.framework.themes".Â
Another change has been that you no longer need a classifier.
If this was the way you previously added your theme prior to FM 6:
<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>halo</artifactId> <type>swc</type> <classifier>theme</classifier> <scope>theme</scope> <version>${flex-framework.version}</version> </dependency>
You now need to change this to:
<dependency> <groupId>com.adobe.flex.framework.themes</groupId> <artifactId>halo</artifactId> <type>swc</type> <scope>theme</scope> <version>${flex-framework.version}</version> </dependency>
An all should work the same way.