2011-03-05 46 views
2

我創建的項目與行家的Flexmojos使用archtype..i的Flexmojos:與FlashBuilder 4一切運行的FlexBuilder 和編譯/是好的,但是當我嘗試 編譯項目的Flexmojos與我有以下錯誤:無法解析<fx:Script>到組件實現


[ERROR] Z:.... \ SRC \主\柔性\ Main.mxml:[6,-1]無法解析< FX:腳本>到一個組件實現。

[INFO] BUILD FAILURE


我的mxml:

<?xml version="1.0" encoding="utf-8"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" 
          xmlns:mx="library://ns.adobe.com/flex/mx" 
           width="100%" height="100%" 
creationComplete="application1_creationCompleteHandler(event)"> 
     <fx:Script> 
       <![CDATA[ 
         import mx.controls.Alert; 
         import mx.events.FlexEvent; 
         protected function 
application1_creationCompleteHandler(event:FlexEvent):void 
         { 
           Alert.show("success!!!!") 
         } 
     ]]></fx:Script> 
</s:Application> 

的pom.xml等:

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.foo</groupId> 
    <artifactId>Bar</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>swf</packaging> 

    <name>Foobar</name> 

    <properties> 
     <flex-sdk.version>4.1.0.16076</flex-sdk.version> 
     <flex-sdk.scope>compile</flex-sdk.scope> 
     <flexmojos.version>3.8</flexmojos.version> 
     <player.version>10.0</player.version> 
    </properties> 
    <pluginRepositories> 
     <!-- 
      Required for regular plugin use until moved over to Maven central 
      repo. 
     --> 
     <pluginRepository> 
      <id>flex-mojos-plugin-repository</id> 
      <url>http://repository.sonatype.org/content/groups/flexgroup/</url> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </pluginRepository> 

     <!-- Required for building plugin from source. --> 
     <pluginRepository> 
      <id>flex-mojos-internal-plugins-repository</id> 
      <url>http://repository.sonatype.org/content/groups/public/</url> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 


    <repositories> 
     <!-- 
      Required for regular plugin use until moved over to Maven central 
      repo. 
     --> 
     <repository> 
      <id>flex-mojos-repository</id> 
      <url>http://repository.sonatype.org/content/groups/flexgroup/</url> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </repository> 

     <!-- Required for building plugin from source. --> 
     <repository> 
      <id>flex-mojos-internal-repository</id> 
      <url>http://repository.sonatype.org/content/groups/public/</url> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 

     <repository> 
      <id>apache-internal-repository</id> 
      <url>https://repository.apache.org/content/repositories/maven-014/</url> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 
    <build> 
     <sourceDirectory>src/main/flex</sourceDirectory> 
     <testSourceDirectory>src/test/flex</testSourceDirectory> 
     <plugins> 

      <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> 
       </dependencies> 
       <configuration> 
        <accessible>false</accessible> 
        <targetPlayer>${player.version}</targetPlayer> 
        <incremental>false</incremental> 
        <debug>false</debug> 
        <locale>en_US</locale> 
        <optimize>true</optimize> 
        <showWarnings>true</showWarnings> 
        <strict>true</strict> 
        <useNetwork>true</useNetwork> 
        <allowSourcePathOverlap>true</allowSourcePathOverlap> 
        <sourcePaths> 
         <path>${basedir}/src/main/flex</path> 
        </sourcePaths> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>unpack-config</id> 
         <goals> 
          <goal>unpack-dependencies</goal> 
         </goals> 
         <phase>generate-resources</phase> 
         <configuration> 
          <outputDirectory>${project.build.directory}/generated-resources</outputDirectory> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

    <dependencies> 
     <!-- Flex framework resource bundles --> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>playerglobal</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <classifier>${player.version}</classifier> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>playerglobal</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>textLayout</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>osmf</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>spark</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>sparkskins</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>rpc</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>datavisualization</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flash-integration</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flex</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>zip</type> 
      <classifier>configs</classifier> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>utilities</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>datavisualization</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flash-integration</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>osmf</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>rpc</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>spark</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>textLayout</artifactId> 
      <version>${flex-sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex-sdk.scope}</scope> 
     </dependency> 

</dependencies> 

</project> 

行家輸出編譯器配置:

INFO] Flex compiler configurations: 
-compiler.external-library-path C:\...\.m2\repository\com\adobe\flex 
\framework\playerglobal\4.1.0.16076\10.0\playerglobal.swc 
-compiler.include-libraries= 
-compiler.library-path C:\...\.m2\repository\com\adobe\flex\framework 
\datavisualization\4.1.0.16076\datavisualization-4.1.0.16076.swc C:\... 
\.m2\repository\com\adobe\flex\framework\flash-integration 
\4.1.0.16076\flash-integration-4.1.0.16076.swc C:\...\.m2\repository 
\com\adobe\flex\framework\flex\4.1.0.16076\flex-4.1.0.16076.swc C:\... 
\.m2\repository\com\adobe\flex\framework\framework 
\4.1.0.16076\framework-4.1.0.16076.swc C:\...\.m2\repository\com\adobe 
\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076.swc C:\... 
\.m2\repository\com\adobe\flex\framework\rpc 
\4.1.0.16076\rpc-4.1.0.16076.swc C:\...\.m2\repository\com\adobe\flex 
\framework\spark\4.1.0.16076\spark-4.1.0.16076.swc C:\... 
\.m2\repository\com\adobe\flex\framework\sparkskins 
\4.1.0.16076\sparkskins-4.1.0.16076.swc C:\...\.m2\repository\com\adobe 
\flex\framework\textLayout\4.1.0.16076\textLayout-4.1.0.16076.swc C: 
\...\.m2\repository\com\adobe\flex\framework\utilities 
\4.1.0.16076\utilities-4.1.0.16076.swc C:\...\.m2\repository\com\adobe 
\flex\framework\datavisualization 
\4.1.0.16076\datavisualization-4.1.0.16076-en_US.rb.swc C:\... 
\.m2\repository\com\adobe\flex\framework\framework 
\4.1.0.16076\framework-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository 
\com\adobe\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076- 
en_US.rb.swc C:\...\.m2\repository\com\adobe\flex\framework\rpc 
\4.1.0.16076\rpc-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com 
\adobe\flex\framework\spark\4.1.0.16076\spark-4.1.0.16076-en_US.rb.swc 
C:\...\.m2\repository\com\adobe\flex\framework\textLayout 
\4.1.0.16076\textLayout-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository 
\com\adobe\flex\framework\flash-integration\4.1.0.16076\flash- 
integration-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com\adobe 
\flex\framework\playerglobal\4.1.0.16076\playerglobal-4.1.0.16076- 
en_US.rb.swc 
-compiler.theme Z:\.....\target\classes\configs\themes\Spark 
\spark.css 
-compiler.accessible=true 
-compiler.allow-source-path-overlap=false 
-compiler.as3=true 
-compiler.debug=false 
-compiler.es=false 
-compiler.fonts.managers flash.fonts.JREFontManager 
flash.fonts.BatikFontManager flash.fonts.AFEFontManager 
flash.fonts.CFFFontManager 
-compiler.fonts.local-fonts-snapshot Z:\.....\target\classes 
\fonts.ser 
-compiler.keep-generated-actionscript=false 
-licenses.license flashbuilder4 952309948800588759250406 
-licenses.license flexbuilder4.displayedStartPageAtLeastOneTime true 
-compiler.locale en_US 
-compiler.optimize=true 
-compiler.source-path Z:\.....\src\main\flex 
-compiler.strict=true 
-use-network=true 
-compiler.verbose-stacktraces=false 
-compiler.actionscript-file-encoding UTF-8 
-target-player 10.0.0 
-default-background-color 8821927 
-default-frame-rate 24 
-default-script-limits 1000 60 
-default-size 500 375 
-compiler.headless-server=false 
-compiler.keep-all-type-selectors=false 
-compiler.use-resource-bundle-metadata=true 
-metadata.date Fri Mar 04 14:04:37 EET 2011 
-metadata.localized-title Main x-default 
-verify-digests=true 
-compiler.namespaces.namespace+=http://ns.adobe.com/mxml/2009,Z:\..... 
\target\classes\config-4.1.0.16076\mxml-2009-manifest.xml 
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/spark,Z: 
\.....\target\classes\config-4.1.0.16076\spark-manifest.xml 
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/mx,Z:\..... 
\target\classes\config-4.1.0.16076\mx-manifest.xml 
-compiler.namespaces.namespace+=http://www.adobe.com/2006/mxml,Z:\..... 
\PozitronUI\target\classes\config-4.1.0.16076\mxml-manifest.xml - 
static-link-runtime-shared-libraries=false -load-config= 
-metadata.language+=en_US 

任何幫助......

問候,

回答

1

一些依賴丟失你的POM文件。 (框架,火花,sparkskins,...) 這裏是我的項目ony的摘錄:

<dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>playerglobal</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <classifier>${flash.player.major}</classifier> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>playerglobal</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>textLayout</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>     
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>osmf</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>     
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>spark</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>sparkskins</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>rpc</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>datavisualization</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flash-integration</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flex</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>zip</type> 
      <classifier>configs</classifier> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>utilities</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>swc</type> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>datavisualization</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flash-integration</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>framework</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>osmf</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>     
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>rpc</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>     
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>spark</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>textLayout</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>rb.swc</type> 
      <scope>${flex.sdk.scope}</scope>   
     </dependency> 
    </dependencies> 
+0

謝謝你的回答。我在編譯範圍中添加這些依賴關係.. BU我得到了同樣的錯誤... – seref 2011-03-05 18:31:42

+0

你可以發佈整個pom.xml嗎? – 2011-03-06 11:41:04

+0

好吧,我更新了整個pom.xml的問題...... – seref 2011-03-06 13:15:31

相關問題