Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Clone the repository:

    Code Block
    themeEmacs
    git clone https://git-wip-us.apache.org/repos/asf/flex-utilities.git utilities

    After this the utilities/maveinzer directory should contain only one "src" directory.

  2. 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.

  3. 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".

...

  1. Create the output directory 

    Code Block
    mkdir c:\Temp\mavenized
  2. Change to the directory where the mavenizer has been created. 

    Code Block
    cd utilities/mavenizer/core/target
  3. 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\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". 

...

  1. 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.

  2. 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 (wink)

  3. You should now see a lot of log output in which the deployer confirms to deploy artifacts to your remote repository.
  4. 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).
  5. You're finished ... have fun (smile)

...

Currently the version of Flexmojos able to work with the updated Mavenizer structure is the 7.1.0 version.

SWC 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="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</version>
        <extensions>true</extensions>
        <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.15.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.15.0</version>
      <type>pom</type>
    </dependency>
    <!-- Flashplayer runtime dependencies -->
    <dependency>
      <groupId>com.adobe.flash.framework</groupId>
      <artifactId>playerglobal</artifactId>
      <version>20.0</version>
      <type>swc</type>
    </dependency>
  </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 to compile a Flex 4.15.0 application that is able to run in a FlashPlayer 20.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="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<artifactId>swf-artifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>swc<<packaging>swf</packaging>

  <build>
 <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>
        <configuration>
          <sourceFile>ApplicationMain.mxml</sourceFile>
        </configuration>
        <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>

In contrast to the SWC Artifact I suggest to add the "sourceFile" attribute to tell the compiler what the main class is. If you don't it will take the first it finds. If there are more than one you could be getting into trouble.