...
Clone the repository:
After this the utilities/maveinzer directory should contain only one "src" directory.Code Block theme Emacs git clone https://git-wip-us.apache.org/repos/asf/flex-utilities.git utilities
Currently the updated Mavenizer is located in the "mavenizer-refactoringmaster" branch, so we have to switch to that first:
Code Block git checkout mavenizer-refactoringdevelop
After this the utilities/mavenizer directory should contain 4 5 sub-directories. This way you know you are on the right branch.
Build the Mavenizer using Maven:
Code Block cd utilities/mavenizermavenizer mvn clean install
You will see a lot of log output and hopefully at the end you should be able to read something like this:
Code Block [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.620s [INFO] Finished at: Sat Jul 12 12:41:42 CEST 2014 [INFO] Final Memory: 40M/230M [INFO] ------------------------------------------------------------------------
Now you have successfully built the mavenizer. The utilities/mavenizer/core/target directory should now contain 2 jar files "core-1.0.0-SNAPSHOT.jar" and "flex-sdk-converter-1.0.0-SNAPSHOT.jar".
...
Create the output directory
Code Block mkdir c:\Temp\mavenized
Change to the directory where the mavenizer has been created.
Code Block cd utilities/mavenizer/core/target
Execute the Mavenizer:
Code Block java -cp jar [path-to-the-sdk-converter-jar]/flex-sdk-converter-1.0.0-SNAPSHOT.jar org.apache.flex.utilities.converter.core.SdkConverter "c:\Temp\"c:\Temp\Apache-Flex-SDKs\flex_sdk_4.12.1-apache" "c:\Temp\mavenized"
After the execution is finished you should have two directories in the "c:\Temp\mavenized" directory "com" and "org".
...
Go to the target directory of the deployer you want to use:
Code Block cd utilities\mavenizer\deployers\aether\target
This directory should contain two jar files.
Execute the deployer:
Code Block java -cpjar aether-deployer-1.0.0-SNAPSHOT-full.jar org.apache.flex.utilities.converter.deployer.aether.AetherDeployer "c:\Temp\mavenized" "{url of your remote repository}" "{username}" "{password}"
Username and password are optional but I pray that you don't have an unsecured remote Maven repository unless you know exactly what you are doing
- You should now see a lot of log output in which the deployer confirms to deploy artifacts to your remote repository.
- After the deployment is finished, you can check your repo, if it contains the artifacts by visiting its (The URL you entered as second argument to the deployer).
- You're finished ... have fun
...
Currently the version of Flexmojos able to work with the updated Mavenizer structure is the 7.1.0-SNAPSHOT version. I will release a 7.1.0 as soon as the Auto Mavenizing of Flex artifacts is included, but this requires an official release of the Mavenizer first. So currently you're stuck to the SNAPSHOT version.
SWC Artifact
.0 version.
SWC Artifact
Code Block |
---|
<?xml version="1.0" |
Code Block |
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my.cool.groupId</groupId> <artifactId>swc-artifact</artifactId> <version>1.0-SNAPSHOT</version> <packaging>swc</packaging> <build> <sourceDirectory>src/main/flex</sourceDirectory> <testSourceDirectory>src/test/flex</testSourceDirectory> <plugins> <plugin> <groupId>net.flexmojos.oss</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>7.1.0-SNAPSHOT<0</version> <extensions>true</extensions> <dependencies> <!-- ThisWithout handles a bug in maventhis FM will use the compiler configured in its master pom, which causeswill problemsresult within flexversion resourcesconflicts --> <dependency> <groupId>net<groupId>org.flexmojosapache.oss<flex</groupId> <artifactId>flexmojos-threadlocaltoolkit-wrapper<<artifactId>compiler</artifactId> <version>7<version>4.115.0-SNAPSHOT<0</version> < <type>pom</dependency>type> <!-- Without this FM will use the compiler configured in its master pom, which will result in version conflicts --> <dependency>/dependency> </dependencies> </plugin> </plugins> </build> <dependencies> <!-- Flex SDK dependencies --> <dependency> <groupId>org.apache.flex</groupId> <artifactId>compiler<<artifactId>framework</artifactId> <version>4.1215.1<0</version> <type>pom</type> <type>pom<</type>dependency> <!-- Flashplayer runtime dependencies --> </dependency> <dependency> </dependencies><groupId>com.adobe.flash.framework</groupId> <<artifactId>playerglobal</plugin>artifactId> </plugins> </build> <dependencies> <version>20.0</version> <!-- Flex SDK dependencies --><type>swc</type> <dependency></dependency> <groupId>org.apache.flex</groupId> <artifactId>framework</artifactId> <version>4.12.1</version> <type>pom</type> </dependency> <!-- Flashplayer runtime dependencies --> <dependency> <groupId>com.adobe.flash.framework</groupId> <artifactId>playerglobal</artifactId> <version>11.1</version> <type>swc</type> </dependency> </dependencies> </</dependencies> </project> |
It is important to note that the two versions of the compiler and the framework have to match each other or you will have trouble. In the above configuration you are using Flexmojos 7.1.0 -SNAPSHOT to compile a Flex 4.1215.1 0 application that is able to run in a FlashPlayer 1120.1 0 and above.
SWF Artifact
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my.cool.groupId</groupId> <artifactId>swf-artifact</artifactId> <version>1.0-SNAPSHOT</version> <packaging>swf</packaging> <build> <sourceDirectory>src/main/flex</sourceDirectory> <testSourceDirectory>src/test/flex</testSourceDirectory> <plugins> <plugin> <groupId>net.flexmojos.oss</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>7.1/www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my.cool.groupId</groupId> <artifactId>swf-artifact</artifactId> <version>1.0-SNAPSHOT</version> <extensions>true</extensions><packaging>swf</packaging> <configuration><build> <sourceFile>ApplicationMain.mxml</sourceFile> </configuration><sourceDirectory>src/main/flex</sourceDirectory> <testSourceDirectory>src/test/flex</testSourceDirectory> <dependencies><plugins> <plugin> <!-- This handles a bug in maven which causes problems with flex resources --> <groupId>net.flexmojos.oss</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>7.1.0</version> <dependency> <extensions>true</extensions> <groupId>net.flexmojos.oss</groupId><configuration> <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId><sourceFile>ApplicationMain.mxml</sourceFile> <version>7.1.0-SNAPSHOT</version></configuration> </dependency><dependencies> <!-- Without this FM will use the compiler configured in its master pom, which will result in version conflicts --> <dependency> <groupId>org.apache.flex</groupId> <artifactId>compiler</artifactId> <version>4.1215.1<0</version> <type>pom</type> </dependency> </dependencies> </plugin> </plugins> </build> <dependencies> <!-- Flex SDK dependencies --> <dependency> <groupId>org.apache.flex</groupId> <artifactId>framework</artifactId> <version>4.1215.1<0</version> <type>pom</type> </dependency> <!-- Flashplayer runtime dependencies --> <dependency> <groupId>com.adobe.flash.framework</groupId> <artifactId>playerglobal</artifactId> <version>11<version>20.1<0</version> <type>swc</type> </dependency> </dependencies> </project> |
...