Versions Compared

Key

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

...

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

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</version>
        <extensions>true</extensions>
        <dependencies>
          <!-- This handles a bug in maven which causes problems with flex resources -->
          <dependency>
            <groupId>net.flexmojos.oss</groupId>
            <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
            <version>4.12.1</version>
          </dependency>
          <!-- 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.12.1</version>
            <type>pom</type>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <!-- Flex SDK dependencies -->
    <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>

</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.12.1 application that is able to run in a FlashPlayer 11.1 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>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.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <sourceFile>ApplicationMain.mxml</sourceFile>
        </configuration>
        <dependencies>
          <!-- This handles a bug in maven which causes problems with flex resources -->
          <dependency>
            <groupId>net.flexmojos.oss</groupId>
            <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
            <version>4.12.1</version>
          </dependency>
          <!-- 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.12.1</version>
            <type>pom</type>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>


  <dependencies>
    <!-- Flex SDK dependencies -->
    <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>

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