2012-05-29 19 views
0

我有一個使用Flexmojos執行單元測試並構建SWC的Maven項目。在執行單元測試,我需要告訴的Flexmojos哪裏我的Flash播放器,這是我通過settings.xml做:在Maven發行版中配置Flash Player與Flexmojos配合使用:執行

<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找不到settings.xml中指定的Flash播放器?我怎樣才能解決這個問題?

UPDATE:

我也曾嘗試以下操作:

  • 設置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] 

...沒有進一步的線索,以什麼失敗。

回答

0

我認爲原因是你明確地試圖激活一個沒有定義在任何地方的配置文件「發佈」。由於Flash Player屬性的定義在配置文件「dev」中定義,因此必須激活此屬性才能提供該屬性。在flexmojos中,您還可以讓flexmojos通過將其命名爲「flashplayer」並將目錄包含在系統路徑中找到該播放器。另一個解決方案是在您的settings.xml中創建一個名爲「release」的重複配置文件,然後protery將可用。

0

也許你是以錯誤的方式調用maven,我不認爲問題來自Flash播放器的位置。該錯誤清楚地表明,「釋放」字符串被讀取爲配置文件,而不應該。你能提供你的Maven命令行嗎?

相關問題