The Mavenizer tool is used to convert the Apache Flex SDKs and Adobe Air SDKs into Maven artifacts. Automatically creating the Directories, pom-files, copying and moving the resources to the correct destinations. These artifacts can then be used in Maven builds using the Flexmojos plugin (Starting with version 7.x).However we are working on a new Apache Maven plugin, but this will take quite a while till it's finished. Until that's done, please feel free to use Flexmojos 7.x branch. https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/Home. Currently development of Flexmojos is done at GITHub and the source is available at: https://github.com/chrisdutz/flexmojos
The Mavenizer consists of several parts:
- Actually there is currently only one type of retriever - the download retriever, which is used to automatically download AIR and Flash binaries from Adobe servers based upon the data stored in the xml file at http://flex.apache.org/installer/sdk-installer-config-4.0.xml)
- Flex Converter (Converts a Flex SDK)
- Flash Converter (Converts an Air SDK)
- Air Converter (Converts the playerglobal for a given Flash version)
- Aether Deployer (Deploys the artifacts directly from inside the Mavenizer VM, a lot faster, but possibly less stable and less options)
- Maven Deployer (Deploys the artifacts using a locally installed Maven version)
The Mavenizer modules were built in a way that they can be utilized by external tools especially Flexmojos, which is able to automatically download and mavenize AIR and Flash resources.
Building the Mavenizer
Here come the steps needed to build the Generator (Assuming you already have a working Maven installation)
- Clone the flex-utilities repo (https://git-wip-us.apache.org/repos/asf/flex-utilities.git)
- Checkout the "develop" branch. (The "mavenizer" directory I will call [home] from now on)
- Go to the directory [home]
- Execute "mvn package"
After the build is finished, the directory "mavenizer/core/target" should now have a jar file called "flex-sdk-converter-1.0.0-SNAPSHOT.jar" this jar contains all you need to mavenize a FDK. If you are however trying to embed mavenization capabilities into a dedicated tool, using the individual artifacts is recommendable.
Using the Mavenizer
- Prepare the directories:
- Use the Flex Installer to download the Flex SDK as well as the Flash and AIR versions you intend on using (I'll call the installation directory "sdkhome")
- Create a directory anywhere which will contain the output (I will call it "fdktarget" from now on)
- Change to the "sdkhome" directory
Execute the following command:
(You should wrap the both directory names in double-quotes if they contain spaces)
- In order to use the generated Maven version, simply copy all files in "fdktarget" to your maven local repository.
Deploying your artifacts to a remote Maven repository
The SDK deployers allow you to deploy any maven structured directory to a remote maven repository as soon as you've got the remote rights. So be sure not to deploy your maven local repository to a remote as this will deploy everything and not only your flex sdks.
Using the Aether deployer
The AetherDeployer needs 2 or 4 ordered parameters separated by spaces:
- fdktarget: The path to the directory the SDKGenerator generated its artifacts to.
- repository-url: The url of the maven repository we want to deploy the artifacts to.
- username: (optional) The username used to deploy the artifacts.
- password: (required only if a username is provided) The password used to deploy the artifacts.
Using the Maven deployer
The MavenDeployer needs 4 ordered parameters separated by spaces:
- directory: The path to the directory to deploy.
- repositoryId: Server Id to map on the <id> under <server> section of settings.xml.
- url: URL where the artifacts will be deployed.
- mvn: The path to the mvn.bat / mvn.sh.
Some specialities with certain FDKs
Flex SDK 2.0:
Version is strange "3.0 Moxie M2.180927". Has to be changed to 184.108.40.206927 in flex-sdk-description.xml
Flex 220.127.116.117A, Flex 18.104.22.1682A, Flex 22.214.171.12458A
I did have some trouble finding out the AIR version as well as the binary artifacts. The sizes and checksums of the airglobal.swc didnt match any of the official AIR artifacts and the adl command didn't output a version. Currently without tweaking these FDKs are generated without working AIR support.
If however you need one of these FDKs you can simply make the generator use the air version you want, by copying the airglobal.swc of the version you want to use into thedirectory "fdkroot/frameworks/libs/air" assuming you have deployed any FDK or Air SDK containing that version of airglobal, the generator will correctly add dependencies to that AIR version.
- Needs a "player" directory in "framework" in order to execute compc (Copy from Flex 4.6.0).
- Needs all the dependencies in place "textlayout", "osmf" and the stuff that needs to be copied into the "[fdkroot]/lib/external" and "[fdkroot]/lib/external/optional" directories. For more instructions on this, please read the README.txt in the root of Your FDK.
- Needs to detect the AIR version the FDK is compatible with, this is currently determined by checking the version of the airglobal.swc in the framework/libs/air/airglobal.swc. Simply copy this from the 4.6 FDK
Download Links to binary versions of Flex and Air
AIR SDKs (From Adobe): http://helpx.adobe.com/air/kb/archived-air-sdk-version.html