Configuring the Flash player for use with Flexmojos executed during a Maven release:perform

1.5k views Asked by At

I have a Maven project that uses Flexmojos to execute unit tests and build a SWC. As it executes unit tests, I need to tell Flexmojos where my Flash player is, which I do via settings.xml:

<profiles>
    <profile>
        <id>dev</id>
        <properties>
            <flex.flashPlayer.command>/Applications/Flash Player Debugger.app/Contents/MacOS/Flash Player Debugger</flex.flashPlayer.command>
        </properties>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>dev</activeProfile>
</activeProfiles>

This works nicely in development, but when I perform a Maven release:perform, it fails with:

[INFO] [WARNING] The requested profile "release" could not be activated because it does not exist.
[INFO] [ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.1-beta:test-run (default-test-run) on project swf-module: Failed to launch Flash Player.  Probably java was not able to find flashplayer.
[INFO] [ERROR] Make sure flashplayer is available on PATH
[INFO] [ERROR] or use -DflashPlayer.command=${flashplayer executable}
[INFO] [ERROR] Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests: Cannot run program "flashplayer": error=2, No such file or directory

Why does release:perform not find the Flash player specified in settings.xml? How can I fix this?

UPDATE:

I have also tried the following:

  • Setting the Flash player as the default program for .swf files (note that this is on a Mac)
  • Adding flashplayer to the path

... all to no avail.

UPDATE 2:

If I put the Flash Player debugger onto the path with the name flashplayer, then the error changes to:

[INFO] [WARNING] The requested profile "release" could not be activated because it does not exist.
[INFO] [ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.1-beta:test-run (default-test-run) on project swf-module: Unexpected return code 1 - /Users/blah/blah/swf-module/target/test-classes/TestRunner.swf -> [Help 1]

... with no further clue as to what failed.

2

There are 2 answers

0
Christofer Dutz On

I think the reason is that you are explicitly trying to activate a profile "release" that is not defined anywhere. As the definition of the Flash Player property is defined in a profile "dev" this has to be activated in order to be able to provide the property. In flexmojos you can also have flexmojos find the player by naming it "flashplayer" and having the directory containing it in the systems path. Another solution woud be to create a duplicate profile in your settings.xml called "release", then the protery will be available.

0
htulipe On

Maybe you are calling maven in a wrong way, I don't think the problem comes from Flash player location. The error clearly shows that the "release" character string is read as a profile while it should not. Can you provide your Maven command line?