我有一个使用 Flexmojos 执行单元测试和构建 SWC 的 Maven 项目。当它执行单元测试时,我需要告诉 Flexmojos 我的 Flash 播放器在哪里,我通过以下方式进行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>
这在开发中效果很好,但是当我执行 Maven 时release:perform
,它失败了:
[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
为什么release:perform
找不到指定的 Flash 播放器settings.xml
?我怎样才能解决这个问题?
更新:
我还尝试了以下方法:
- 将 Flash 播放器设置为
.swf
文件的默认程序(注意这是在 Mac 上) - 添加
flashplayer
到路径
……一切都无济于事。
更新 2:
如果我将 Flash Player 调试器放在名称为 的路径上flashplayer
,则错误变为:
[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]
......没有进一步的线索,什么失败了。