apache-flexairargument-dependent-lookupflexmojosflex-mojos

Running AIR application tests with Maven/FlexMojos 4.2 beta


I have Maven module which is an AIR application. I use the FlexMojos plugin (version 4.2-beta).

EDIT: further investigation revealed that the issue is the descriptor used for the tests TestRunner.xml has the AIR 2.6 namespace, while my adl is version 3.6. Thus, I need a way to control this version or the whole descriptor.

I always get this error when running the test goal :

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:test-run (default-test-run) on project mobile-app: Unexpected return code 9

Here's my build configuration (flex.sdk.version=4.5.1.21328)

<plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>${flexmojos.version}</version>
    <extensions>true</extensions>
    <dependencies>
        <dependency>
            <groupId>com.adobe.flex</groupId>
            <artifactId>compiler</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>com.adobe.flex.compiler</groupId>
            <artifactId>adt</artifactId>
            <version>${flex.sdk.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</plugin>

Using mvn test -X, I can see that the ADL is invoked:

[DEBUG] [LAUNCHER] exec: [adl] - /XXX/mobile-app/target/test-classes/TestRunner.xml

As far I know, error code 9 from adl means: The main application content file is not a valid SWF or HTML file..

What am I missing? Any help is appreciated!


Solution

  • Unfortunately, the best way I found to control Adobe AIR version is to upgrade to FlexMojos to 5.1-beta. This version accepts a parameter flex.airVersion, which is then written inside the descriptor.