2014-09-26 64 views
0

我的Flex應用程序,完全菜單(基於mx.controls.Menu和flexlib.controls.ScrollableMenu)存在有線問題。mx.controls.Menu在由flexmojos-maven-plugin構建時無法正確呈現

當我通過FlashBuilder菜單工作構建我的應用程序時。見截圖:

Menu OK

但是,當我使用Maven構建它的Flexmojos-Sonatype的,插件菜單壞了(它不會呈現正確根據labelField屬性,並沒有趕上像鼠標點擊任何事件) 。見截圖:

Broken menu

我.actionScriptProperties文件中:

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<actionScriptProperties analytics="false" mainApplicationPath="ats.mxml" projectUUID="802474ea-5e3c-4d2c-bdaa-8c263c0828f4" version="6"> 
    <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="false" copyDependentFiles="true" flexSDK="Flex 3.3" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderLocation="D:/flex" outputFolderPath="bin-debug" rootURL="http://localhost:8080/flex/" sourceFolderPath="src/main/flex" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> 
    <compilerSourcePath /> 
    <libraryPath defaultLinkType="1"> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation/3.3.0.4852/automation-3.3.0.4852.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_agent/3.3.0.4852/automation_agent-3.3.0.4852.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_dmv/3.3.0.4852/automation_dmv-3.3.0.4852.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_flashflexkit/3.3.0.4852/automation_flashflexkit-3.3.0.4852.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_agent/3.3.0.4852/automation_agent-3.3.0.4852-en_US.rb.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation/3.3.0.4852/automation-3.3.0.4852-en_US.rb.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flexunit/flexunit/0.90/flexunit-0.90.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/as3corelib/0.92.1/as3corelib-0.92.1.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/google/code/flexlib/flexlib/2.6-M3/flexlib-2.6-M3.swc" useDefaultLinkType="true"/> 
     <libraryPathEntry kind="4" path=""> 
     <modifiedEntries> 
      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="true"/> 
     </modifiedEntries> 
     <excludedEntries> 
      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/> 
      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> 
      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> 
      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/> 
     </excludedEntries> 
     </libraryPathEntry> 
    </libraryPath> 
    <sourceAttachmentPath> 
     <sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/> 
    </sourceAttachmentPath> 
    </compiler> 
    <applications> 
    <application path="myApp.mxml"/> 
    </applications> 
    <modules/> 
    <buildCSSFiles/> 
</actionScriptProperties> 

我的有效POM文件:

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.application.myApp</groupId> 
    <artifactId>myApp</artifactId> 
    <version>trunk-SNAPSHOT</version> 
    <packaging>swf</packaging> 
    <dependencyManagement> 
    <dependencies> 
     <dependency> 
     <groupId>com.google.code.flexlib</groupId> 
     <artifactId>flexlib</artifactId> 
     <version>2.6-M3</version> 
     <type>swc</type> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 
    <dependencies> 
    <dependency> 
     <groupId>com.google.code.flexlib</groupId> 
     <artifactId>flexlib</artifactId> 
     <type>swc</type> 
     </dependency> 
    <dependency> 
     <groupId>com.adobe.flex.framework</groupId> 
     <artifactId>flex-framework</artifactId> 
     <version>3.3.0.4852</version> 
     <type>pom</type> 
     <scope>compile</scope> 
     <exclusions> 
     <exclusion> 
      <artifactId>playerglobal</artifactId> 
      <groupId>com.adobe.flex.framework</groupId> 
     </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>com.adobe.flex.framework</groupId> 
     <artifactId>playerglobal</artifactId> 
     <version>3.3.0.4852</version> 
     <type>swc</type> 
     <classifier>10</classifier> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.adobe.flexunit</groupId> 
     <artifactId>flexunit</artifactId> 
     <version>0.90</version> 
     <type>swc</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.adobe.flex.framework</groupId> 
     <artifactId>as3corelib</artifactId> 
     <version>0.92.1</version> 
     <type>swc</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.adobe.flex.framework</groupId> 
     <artifactId>datavisualization</artifactId> 
     <version>3.3.0.4852</version> 
     <type>swc</type> 
     <scope>compile</scope> 
    </dependency> 
    </dependencies> 
    <build> 
    <extensions> 
     <extension> 
     <groupId>org.apache.maven.wagon</groupId> 
     <artifactId>wagon-http-lightweight</artifactId> 
     <version>1.0</version> 
     </extension> 
    </extensions> 
    <pluginManagement> 
     <plugins> 
     <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <version>1.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2-beta-5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.1</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-release-plugin</artifactId> 
      <version>2.0</version> 
     </plugin> 
     <plugin> 
      <groupId>org.sonatype.flexmojos</groupId> 
      <artifactId>flexmojos-maven-plugin</artifactId> 
      <version>4.0-RC2</version> 
      <extensions>true</extensions> 
      <executions> 
      <execution> 
       <phase>package</phase> 
       <goals> 
       <goal>sources</goal> 
       </goals> 
       <configuration> 
       <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
       <licenses> 
        <flexbuilder3>...</flexbuilder3> 
       </licenses> 
       <targetPlayer>10.2.0</targetPlayer> 
       <accessible>true</accessible> 
       <headlessServer>true</headlessServer> 
       <localesCompiled> 
        <locale>en_US</locale> 
       </localesCompiled> 
       <verboseStacktraces>true</verboseStacktraces> 
       <compilerWarnings> 
        <assignmentWithinConditional>true</assignmentWithinConditional> 
        <constructorReturnsValue>true</constructorReturnsValue> 
        <duplicateArgumentNames>true</duplicateArgumentNames> 
        <duplicateVariableDef>true</duplicateVariableDef> 
        <noConstructor>true</noConstructor> 
       </compilerWarnings> 
       <generateHtmlWrapper>false</generateHtmlWrapper> 
       <enableM2e>false</enableM2e> 
       </configuration> 
      </execution> 
      <execution> 
       <id>swf-optimization</id> 
       <goals> 
       <goal>optimize-swf</goal> 
       </goals> 
       <configuration> 
       <attachOriginalArtifact>false</attachOriginalArtifact> 
       <reduce>false</reduce> 
       <reduceMergeABC>false</reduceMergeABC> 
       <reduceMergeCF>false</reduceMergeCF> 
       <reduceSortCPool>false</reduceSortCPool> 
       <strip>false</strip> 
       <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
       <licenses> 
        <flexbuilder3>...</flexbuilder3> 
       </licenses> 
       <targetPlayer>10.2.0</targetPlayer> 
       <accessible>true</accessible> 
       <headlessServer>true</headlessServer> 
       <localesCompiled> 
        <locale>en_US</locale> 
       </localesCompiled> 
       <verboseStacktraces>true</verboseStacktraces> 
       <compilerWarnings> 
        <assignmentWithinConditional>true</assignmentWithinConditional> 
        <constructorReturnsValue>true</constructorReturnsValue> 
        <duplicateArgumentNames>true</duplicateArgumentNames> 
        <duplicateVariableDef>true</duplicateVariableDef> 
        <noConstructor>true</noConstructor> 
       </compilerWarnings> 
       <generateHtmlWrapper>false</generateHtmlWrapper> 
       <enableM2e>false</enableM2e> 
       </configuration> 
      </execution> 
      </executions> 
      <dependencies> 
      <dependency> 
       <groupId>com.adobe.flex</groupId> 
       <artifactId>license</artifactId> 
       <version>3</version> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.sonatype.flexmojos</groupId> 
       <artifactId>flexmojos-flex3-compatibility-layer</artifactId> 
       <version>4.0-RC2</version> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.adobe.flex</groupId> 
       <artifactId>compiler</artifactId> 
       <version>3.3.0.4852</version> 
       <type>pom</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.adobe.flex</groupId> 
       <artifactId>adt</artifactId> 
       <version>3.3.0.4852</version> 
       <scope>compile</scope> 
      </dependency> 
      </dependencies> 
      <configuration> 
      <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
      <licenses> 
       <flexbuilder3>...</flexbuilder3> 
      </licenses> 
      <targetPlayer>10.2.0</targetPlayer> 
      <accessible>true</accessible> 
      <headlessServer>true</headlessServer> 
      <localesCompiled> 
       <locale>en_US</locale> 
      </localesCompiled> 
      <verboseStacktraces>true</verboseStacktraces> 
      <compilerWarnings> 
       <assignmentWithinConditional>true</assignmentWithinConditional> 
       <constructorReturnsValue>true</constructorReturnsValue> 
       <duplicateArgumentNames>true</duplicateArgumentNames> 
       <duplicateVariableDef>true</duplicateVariableDef> 
       <noConstructor>true</noConstructor> 
      </compilerWarnings> 
      <generateHtmlWrapper>false</generateHtmlWrapper> 
      <enableM2e>false</enableM2e> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-deploy-plugin</artifactId> 
      <version>2.5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-clean-plugin</artifactId> 
      <version>2.4.1</version> 
     </plugin> 
     </plugins> 
    </pluginManagement> 
    <plugins> 
     <plugin> 
     <artifactId>maven-release-plugin</artifactId> 
     <version>2.0</version> 
     <configuration> 
      <allowTimestampedSnapshots>true</allowTimestampedSnapshots> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.sonatype.flexmojos</groupId> 
     <artifactId>flexmojos-maven-plugin</artifactId> 
     <version>4.0-RC2</version> 
     <extensions>true</extensions> 
     <executions> 
      <execution> 
      <id>default-compile-swf</id> 
      <phase>compile</phase> 
      <goals> 
       <goal>compile-swf</goal> 
      </goals> 
      <configuration> 
       <sourceFile>myApp.mxml</sourceFile> 
       <ignoreVersionIssues>true</ignoreVersionIssues> 
       <skipTests>true</skipTests> 
       <compilerWarnings> 
       <warn-no-constructor>false</warn-no-constructor> 
       <show-binding-warnings>false</show-binding-warnings> 
       <warn-duplicate-variable-def>false</warn-duplicate-variable-def> 
       <assignmentWithinConditional>true</assignmentWithinConditional> 
       <constructorReturnsValue>true</constructorReturnsValue> 
       <duplicateArgumentNames>true</duplicateArgumentNames> 
       <duplicateVariableDef>true</duplicateVariableDef> 
       <noConstructor>true</noConstructor> 
       </compilerWarnings> 
       <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
       <licenses> 
       <flexbuilder3>...</flexbuilder3> 
       </licenses> 
       <targetPlayer>10.2.0</targetPlayer> 
       <accessible>true</accessible> 
       <headlessServer>true</headlessServer> 
       <localesCompiled> 
       <locale>en_US</locale> 
       </localesCompiled> 
       <verboseStacktraces>true</verboseStacktraces> 
       <generateHtmlWrapper>false</generateHtmlWrapper> 
       <enableM2e>false</enableM2e> 
      </configuration> 
      </execution> 
      <execution> 
      <phase>package</phase> 
      <goals> 
       <goal>sources</goal> 
      </goals> 
      <configuration> 
       <sourceFile>myApp.mxml</sourceFile> 
       <ignoreVersionIssues>true</ignoreVersionIssues> 
       <skipTests>true</skipTests> 
       <compilerWarnings> 
       <warn-no-constructor>false</warn-no-constructor> 
       <show-binding-warnings>false</show-binding-warnings> 
       <warn-duplicate-variable-def>false</warn-duplicate-variable-def> 
       <assignmentWithinConditional>true</assignmentWithinConditional> 
       <constructorReturnsValue>true</constructorReturnsValue> 
       <duplicateArgumentNames>true</duplicateArgumentNames> 
       <duplicateVariableDef>true</duplicateVariableDef> 
       <noConstructor>true</noConstructor> 
       </compilerWarnings> 
       <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
       <licenses> 
       <flexbuilder3>...</flexbuilder3> 
       </licenses> 
       <targetPlayer>10.2.0</targetPlayer> 
       <accessible>true</accessible> 
       <headlessServer>true</headlessServer> 
       <localesCompiled> 
       <locale>en_US</locale> 
       </localesCompiled> 
       <verboseStacktraces>true</verboseStacktraces> 
       <generateHtmlWrapper>false</generateHtmlWrapper> 
       <enableM2e>false</enableM2e> 
      </configuration> 
      </execution> 
      <execution> 
      <id>swf-optimization</id> 
      <goals> 
       <goal>optimize-swf</goal> 
      </goals> 
      <configuration> 
       <attachOriginalArtifact>false</attachOriginalArtifact> 
       <reduce>false</reduce> 
       <reduceMergeABC>false</reduceMergeABC> 
       <reduceMergeCF>false</reduceMergeCF> 
       <reduceSortCPool>false</reduceSortCPool> 
       <strip>false</strip> 
       <sourceFile>myApp.mxml</sourceFile> 
       <ignoreVersionIssues>true</ignoreVersionIssues> 
       <skipTests>true</skipTests> 
       <compilerWarnings> 
       <warn-no-constructor>false</warn-no-constructor> 
       <show-binding-warnings>false</show-binding-warnings> 
       <warn-duplicate-variable-def>false</warn-duplicate-variable-def> 
       <assignmentWithinConditional>true</assignmentWithinConditional> 
       <constructorReturnsValue>true</constructorReturnsValue> 
       <duplicateArgumentNames>true</duplicateArgumentNames> 
       <duplicateVariableDef>true</duplicateVariableDef> 
       <noConstructor>true</noConstructor> 
       </compilerWarnings> 
       <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
       <licenses> 
       <flexbuilder3>...</flexbuilder3> 
       </licenses> 
       <targetPlayer>10.2.0</targetPlayer> 
       <accessible>true</accessible> 
       <headlessServer>true</headlessServer> 
       <localesCompiled> 
       <locale>en_US</locale> 
       </localesCompiled> 
       <verboseStacktraces>true</verboseStacktraces> 
       <generateHtmlWrapper>false</generateHtmlWrapper> 
       <enableM2e>false</enableM2e> 
      </configuration> 
      </execution> 
     </executions> 
     <dependencies> 
      <dependency> 
      <groupId>com.adobe.flex</groupId> 
      <artifactId>license</artifactId> 
      <version>3</version> 
      <scope>compile</scope> 
      </dependency> 
      <dependency> 
      <groupId>org.sonatype.flexmojos</groupId> 
      <artifactId>flexmojos-flex3-compatibility-layer</artifactId> 
      <version>4.0-RC2</version> 
      <scope>compile</scope> 
      </dependency> 
      <dependency> 
      <groupId>com.adobe.flex</groupId> 
      <artifactId>compiler</artifactId> 
      <version>3.3.0.4852</version> 
      <type>pom</type> 
      <scope>compile</scope> 
      </dependency> 
      <dependency> 
      <groupId>com.adobe.flex</groupId> 
      <artifactId>adt</artifactId> 
      <version>3.3.0.4852</version> 
      <scope>compile</scope> 
      </dependency> 
     </dependencies> 
     <configuration> 
      <sourceFile>ats.mxml</sourceFile> 
      <ignoreVersionIssues>true</ignoreVersionIssues> 
      <skipTests>true</skipTests> 
      <compilerWarnings> 
      <warn-no-constructor>false</warn-no-constructor> 
      <show-binding-warnings>false</show-binding-warnings> 
      <warn-duplicate-variable-def>false</warn-duplicate-variable-def> 
      <assignmentWithinConditional>true</assignmentWithinConditional> 
      <constructorReturnsValue>true</constructorReturnsValue> 
      <duplicateArgumentNames>true</duplicateArgumentNames> 
      <duplicateVariableDef>true</duplicateVariableDef> 
      <noConstructor>true</noConstructor> 
      </compilerWarnings> 
      <actionscriptFileEncoding>UTF-8</actionscriptFileEncoding> 
      <licenses> 
      <flexbuilder3>...</flexbuilder3> 
      </licenses> 
      <targetPlayer>10.2.0</targetPlayer> 
      <accessible>true</accessible> 
      <headlessServer>true</headlessServer> 
      <localesCompiled> 
      <locale>en_US</locale> 
      </localesCompiled> 
      <verboseStacktraces>true</verboseStacktraces> 
      <generateHtmlWrapper>false</generateHtmlWrapper> 
      <enableM2e>false</enableM2e> 
     </configuration> 
     </plugin> 
     <plugin> 
     <artifactId>maven-clean-plugin</artifactId> 
     <version>2.4.1</version> 
     <executions> 
      <execution> 
      <id>default-clean</id> 
      <phase>clean</phase> 
      <goals> 
       <goal>clean</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-resources-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>default-resources</id> 
      <phase>process-resources</phase> 
      <goals> 
       <goal>resources</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>default-testResources</id> 
      <phase>process-test-resources</phase> 
      <goals> 
       <goal>testResources</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-install-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>default-install</id> 
      <phase>install</phase> 
      <goals> 
       <goal>install</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-deploy-plugin</artifactId> 
     <version>2.5</version> 
     <executions> 
      <execution> 
      <id>default-deploy</id> 
      <phase>deploy</phase> 
      <goals> 
       <goal>deploy</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

我發現使用MonsterDebugger,在運行時菜單對象,它的MenuItemRenderers創建。我使用Flex SDK 3.3,FlashBuilder 4,Maven 3.0.5,flexmojos-maven-plugin 4.0-RC2。我使用Flex SDK 3.3,FlashBuilder 4,Maven 3.0.5,flexmojos-maven-plugin 4.0-RC2。你知道FlashBuilder和Maven構建我的應用程序有什麼區別嗎?謝謝你的回覆。

+0

您是否使用過'link-report'來檢查兩個版本之間的差異? – Brian 2014-09-26 15:20:05

+0

而你正在使用一個真正老版本的flexmojos。對於Adobe Flex來說,最近的版本是6.0.1(但是對於更改的組標識:net.flexmojos.oss),對於Apache Flex,它的版本是7.0.1 – 2014-10-12 17:49:11

+0

您正在使用Flex和Flexmojos的瘋狂舊版本,而您重複了很多配置,因爲您只需要在pluginManagement或插件部分配置插件(您目前擁有一切兩次)。我推薦的是查看FlexMojos在目標目錄中創建的「modulename-config.xml」(自動創建6.x和7.x)以及FlashBuilder的「-dump-config」命令行選項。如果您比較創建的配置轉儲,您應該快速找出發生了什麼問題。 – 2014-11-04 09:26:04

回答

0

通過Flash構建器純粹構建您的項目不會爲您提供使用FlashBuilder/Maven集成構建項目的敏捷開發。作爲一個獨立的開發環境,Flash Builder在版本和依賴管理領域往往缺乏。當您看到您的項目不斷髮展壯大並達到新版本時,與使用Apache Ant任務運行器相比,您將發現使用Flash Builder的Maven有價值。任何能夠幫助管理乾淨地管理依賴關係,支持模塊化和易於管理的更新的任何東西都是值得的。如果你還沒有,你可能想在flex/maven上籤出adobe資源。

http://www.adobe.com/devnet/flex/articles/flex-maven-flexmojos-pt1.html