簡體   English   中英

Maven Flex構建失敗

[英]maven flex build failed

我正在嘗試使用2個模塊在Eclipse中構建一個Maven項目,一個模塊是Java代碼,另一個模塊是Flex代碼。

安裝的Maven版本是3.3.9,jdk是jdk7_u80。

maven install -X命令給我以下錯誤:

[DEBUG]從ClassRealm [project> project.project:prjt-flex:01.00.00,父級:ClassRealm [maven.api,父級:null]]中查找用於打包swf的生命周期映射。[錯誤]內部錯誤:java.lang。 ClassCastException:無法將java.lang.String強制轉換為org.apache.maven.lifecycle.mapping.LifecyclePhase-> [Help 1] org.apache.maven.InternalErrorException:內部錯誤:java.lang.ClassCastException:java.lang.String無法在org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)的org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)處轉換為org.apache.maven.lifecycle.mapping.LifecyclePhase )在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)在org.apache.maven.cli.MavenCli.main(MavenCli.java:199)在sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法) )at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.ja va:606)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)at org.codehaus org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)處的.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)原因:java.lang.ClassCastException:java.lang無法將.String強制轉換為org.apache.maven.lifecycle.mapping.LifecyclePhase

在以下pom.xml文件中,問題似乎與flex模塊有關:

<properties>
        <flex.version>4.5.1.21328</flex.version>
        <template.dir>src/main/html-template</template.dir> 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <flexmojos.version>4.0-RC2</flexmojos.version>      
    </properties>
    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>${flexmojos.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <fullSynchronization>true</fullSynchronization>
                    <showWarnings>false</showWarnings>
                    <optimize>true</optimize>
                    <allowSourcePathOverlap>true</allowSourcePathOverlap>
                    <sourceFile>flexprojt.mxml</sourceFile>
                    <output>target/flexprojt.swf</output>                   
                    <localesCompiled>                       
                        <locale>en_US</locale>
                    </localesCompiled>
                    <includeStylesheets>
                        <stylesheet>
                            <name>style.css</name>
                            <path>assets/css</path>
                        </stylesheet>
                    </includeStylesheets>
                    <localesSourcePath>locale/{locale}</localesSourcePath>
                    <compilerSourcePath>
                        <path>src/main/flex</path>
                    </compilerSourcePath>
                    <rslUrls>
                        <rsl>{artifactId}_{version}.{extension}</rsl>
                    </rslUrls>
                    <targetPlayer>${flash.version}</targetPlayer>
                    <fonts>
                        <advancedAntiAliasing>true</advancedAntiAliasing>
                        <maxCachedFonts>20</maxCachedFonts>
                        <maxGlyphsPerFace>1000</maxGlyphsPerFace>
                        <managers>
                            <manager>flash.fonts.JREFontManager</manager>
                            <manager>flash.fonts.AFEFontManager</manager>
                            <manager>flash.fonts.BatikFontManager</manager> 
                            <manager>flash.fonts.CFFFontManager</manager>                           
                        </managers>
                    </fonts>
                    <modules>
                        <module>
                            <sourceFile>context.mxml</sourceFile>
                            <finalName>context</finalName>
                            <destinationPath>/</destinationPath>
                        </module>
                    </modules>
                </configuration>
                <executions> 
                    <execution> 
                        <goals> 
                            <goal>wrapper</goal> 
                        </goals> 
                        <configuration>
                            <templateURI>folder:html-template</templateURI>
                            <parameters> 
                                <swf>${project.build.finalName}</swf> 
                                <width>100%</width> 
                                <height>100%</height> 
                            </parameters>
                        </configuration> 
                    </execution> 
                </executions> 
                <dependencies>
                    <dependency>
                        <groupId>org.sonatype.flexmojos</groupId>
                        <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
                        <version>${flexmojos.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>${flex.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.adobe.flex.compiler</groupId>
                        <artifactId>flex-fontkit</artifactId>
                        <version>${flex.version}</version>
                        <type>jar</type>
                    </dependency>
                    <dependency>
                        <groupId>com.adobe.flex.compiler</groupId>
                        <artifactId>afe</artifactId>
                        <version>${flex.version}</version>
                        <type>jar</type>
                    </dependency>
                    <dependency>
                        <groupId>com.adobe.flex.compiler</groupId>
                        <artifactId>aglj40</artifactId>
                        <version>${flex.version}</version>
                        <type>jar</type>
                    </dependency>
                    <dependency>
                        <groupId>com.adobe.cairngorm</groupId>
                        <artifactId>cairngorm3</artifactId>
                        <version>3.0.21</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.3.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.5</version>
            </plugin>
        </plugins>
    </build>

我通過使用maven 3.1.1版本構建項目來解決此問題。

但是我仍然想用3.3.9版本構建它,我不知道我需要哪個版本的Flex編譯器。

您應該將您的IDE指向使用外部安裝的(在您的OS上)版本的maven,而不要使用其捆綁的maven。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM