Я пытаюсь построить проект maven в Eclipse с двумя модулями, один из которых является кодом Java, а другой - гибким.maven flex build failed
Установленная версия maven 3.3.9, jdk - jdk7_u80.
The Maven установить -X команда дала мне следующую ошибку:
[DEBUG] Looking up lifecyle mappings for packaging swf from ClassRealm[project>project.project:prjt-flex:01.00.00, parent: ClassRealm[maven.api, parent: null]] [ERROR] Internal error: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java: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.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase at
Проблема, кажется, идет с модулем гибкого, в следующем в pom.xml:
<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? – user565
На самом деле я строю свой проект flex с 3.9.9, который имеет версию 4.5.1.21328. После этого я использовал maven 3.1.1, и проблема была решена. Какая у вас ошибка? – Selma
получает почти такое же исключение, как и в вашем вопросе: [ERROR] Внутренняя ошибка: java.lang.ClassCastException: java.lang.String не может быть добавлено в org.apache.maven.lifecycle.mapping.LifecyclePhase -> [Help 1] – user565