S:应用程序无法解析输入

时间:2012-07-23 16:48:29

标签: flex maven flexmojos flex-mojos

您是Flex的新手,并致力于Flex与Flexmojos(Maven插件)的集成,我尝试集成,但我在Main.mxml编译期间遇到了问题

  

:无法解析应用程序以输入

使用Flex SDK 4.6,我读了几个指定检查命名空间并检查我的SDK版本的解决方案,一切都很好。甚至mx:应用程序返回相同的错误。

如果有人遇到这样的问题,请提出建议!

感谢。

- 编辑的

这是代码

<?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" minWidth="955" minHeight="600" currentState="loginState"
               backgroundColor="#788E99" xmlns:Mxmls="Mxmls.*"
               creationComplete="siteData.send()">
    <fx:Declarations>
        <mx:HTTPService url="assets/content.xml" id="siteData" resultFormat="e4x"/> 
    </fx:Declarations>

    <!-- <fx:Style source="../Cat-Clv.css">
    </fx:Style>-->

    <fx:Declarations>
        <fx:XMLList id="mainMenuXMLList">
            <menuitem id="adminmenu" label="{resourceManager.getString('resources','menubar.admin')}" data="admin" percentWidth="12.5" visible="false">

代码就像这样开始。 pom文件

<?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>

    <parent>
        <artifactId>abc</artifactId>
        <groupId>abc.abc.abc</groupId>
        <version>0.7</version>
    </parent>

    <groupId>abc.abc.abc.swf</groupId>
    <artifactId>abc-swf</artifactId>
    <version>0.3</version>
    <packaging>swf</packaging>

    <name>swf Application</name>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <!-- <version>3.8</version> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> 
                    <artifactId>compiler</artifactId> <version>3.2.0.3958</version> <type>pom</type> 
                    </dependency> </dependencies> -->
                <dependencies>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.6.b.23201</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
                <extensions>true</extensions>
                <configuration>
                    <iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking>true</iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking>

                    <locales>
                        <locale>en_US</locale>
                        <locale>fr_FR</locale>
                    </locales>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>flex-framework</artifactId> 
            <version>3.2.0.3958</version> <version>3.4.0.9271</version> <type>pom</type> 
            </dependency> -->

        <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>4.6.b.23201</version>
            <type>swz</type>
        </dependency>

        <!-- <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>flex-framework</artifactId> 
            <version>3.4.0.9271</version> <type>pom</type> </dependency> -->
        <dependency>
            <groupId>com.adobe.flexunit</groupId>
            <artifactId>flexunit</artifactId>
            <version>0.85</version>
            <type>swc</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.cat.clv.swc</groupId>
            <artifactId>clv-swc</artifactId>
            <version>0.3</version>
            <type>swc</type>
        </dependency>
    </dependencies>

    <profiles>
        <profile><!--https://docs.sonatype.org/pages/viewpage.action?pageId=2949459 -->
            <id>m2e</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.maven.ide.eclipse</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>0.9.9-SNAPSHOT</version>
                        <configuration>
                            <mappingId>customizable</mappingId>
                            <configurators>
                                <configurator
                                    id='org.maven.ide.eclipse.configuration.flex.configurator' />
                            </configurators>
                            <mojoExecutions>
                                <mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
                            </mojoExecutions>
                        </configuration>
                    </plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-resources-plugin</artifactId>
                            <version>2.4</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>

1 个答案:

答案 0 :(得分:1)

这意味着你的swf中不包含spark.swc,这是我配置FlexMojo的方式:

<configuration>
   <flashplayer.version.swf>13</flashplayer.version.swf>
   <sourceFile>org/htulipe/MyApp.mxml</sourceFile>          
</configuration> 

以下是我声明Flash依赖项的方法:

<dependencies>
    <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>flex-framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>pom</type>
        <exclusions> 
            <exclusion> 
                <groupId>com.adobe.flex.framework</groupId> 
                <artifactId>playerglobal</artifactId> 
            </exclusion> 
        </exclusions>
    </dependency>

    <dependency> 
        <groupId>com.adobe.flex.framework</groupId> 
        <artifactId>playerglobal</artifactId> 
        <version>${flex.sdk.version}</version>
        <classifier>${flex.player.version.major}.${flex.player.version.minor}</classifier>
        <type>swc</type>
    </dependency> 

    <dependency>
        <groupId>com.adobe.flexunit</groupId>
        <artifactId>flexunit</artifactId>
        <version>4.0-rc-1</version>
        <type>swc</type>
        <scope>test</scope>
    </dependency>
</dependencies>

希望它可能会有所帮助。另外,我建议不要将iKnowWhatImDoingPleaseBreakMyBuildIwontBlameFlexmojosForStopWorking选项设置为true。该选项的名称非常雄辩。 :)