I have a Flex project with multiple MXML files so I'm using the
<moduleFiles> configuration of the flexmojos-maven-plugin as follows
(we include a SWC dependency also):
<properties>
<flexSDKVersion>3.3.0.4852</flexSDKVersion>
<flexmojos.version>3.4-SNAPSHOT</flexmojos.version>
<flashVersion>10.0.0</flashVersion>
</properties>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<version>${flexmojos.version}</version>
<configuration>
<targetPlayer>${flashVersion}</targetPlayer>
<moduleFiles>
<module>main.mxml</module>
<module>battle.mxml</module>
</moduleFiles>
When I run the outputted SWF's from my target/ folder for example pvp-
client-1.0-SNAPSHOT-main.swf or pvp-client-1.0-SNAPSHOT-battle.swf in
a browser I get the following Flash Debug error:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/
internal::docFrameHandler()
at mx.managers::SystemManager/docFrameListener()
But if I run the main artifact pvp-client-1.0-SNAPSHOT.swf (which I
believe is compiled off of my main.mxml) I don't get any errors.
Does the flexmojo plugin somehow compile the modules differently than
the main artifact, am I missing some configuration flag? The module
swf's are significantly smaller than the default artifact SWF (58kb
versus 783kb), which leads me to believe however I'm putting together
the modules it's not linking in something?
Here's my full pom.xml in case the details in there help (only
weirdness is we need Flash 10, and we include a SWC dependency
installed in our local Nexus repo).
<?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>
<parent>
<groupId>com.webwars</groupId>
<artifactId>pvp-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pvp-parent</relativePath>
</parent>
<groupId>com.webwars</groupId>
<artifactId>pvp-client</artifactId>
<version>1.0-SNAPSHOT</version>
<name>pvp-client</name>
<packaging>swf</packaging>
<properties>
<flexSDKVersion>3.3.0.4852</flexSDKVersion>
<flexmojos.version>3.4-SNAPSHOT</flexmojos.version>
<flashVersion>10.0.0</flashVersion>
</properties>
<repositories>
<repository>
<id>FlexGroup Release</id>
<name>FlexGroup Release</name>
<url>http://repository.sonatype.org/content/groups/
flexgroup/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>FlexGroup Release</id>
<name>FlexGroup Release</name>
<url>http://repository.sonatype.org/content/groups/
flexgroup/</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<version>${flexmojos.version}</version>
<configuration>
<targetPlayer>${flashVersion}</targetPlayer>
<moduleFiles>
<module>main.mxml</module>
<module>battle.mxml</module>
</moduleFiles>
<sourcePaths>
<path>lib</path>
<path>src</path>
</sourcePaths>
</configuration>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flexSDKVersion}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<executions>
<execution>
<goals>
<goal>wrapper</goal>
</goals>
<configuration>
<parameters>
<templateURI>folder:/html-template/</
templateURI>
<swf>${build.finalName}</swf>
<width>100%</width>
<height>100%</height>
</parameters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>${flexSDKVersion}</version>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flexSDKVersion}</version>
<classifier>10</classifier>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flexSDKVersion}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<!-- flexmojos Unit testing support -->
<dependency>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-unittest-flexunit4</artifactId>
<version>${flexmojos.version}</version>
<type>swc</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.polygonal</groupId>
<artifactId>as3ds</artifactId>
<version>1.04</version>
<type>swc</type>
</dependency>
</dependencies>
</project>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos?hl=en?hl=en
http://blog.flex-mojos.info/
-~----------~----~----~----~------~----~------~--~---