views:

1168

answers:

2

My projects UI is built using Flex4.1..I am using maven2 and trying to figure out which flex-mojo version should I use for compiling.

I tried with the following,

<flex.sdk.version>4.1.0.16076</flex.sdk.version>
<flex.mojo.version>3.6.1</flex.mojo.version>

but am running into issues..

[INFO] Flex compiler and flex framework versions doesn't match. Compiler: '3.2.0.3958' - Framework: '4.1.0.16076'. You can use 'ignoreVersionIssues' to disable this check. Please refer to Flexmojos maven doc. If you prefer fixing it instead of ignoring, take a look at: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.BuildFailureException: Flex compiler and flex framework versions doesn't match. Compiler: '3.2.0.3958' - Framework: '4.1.0.16076'. You can use 'ignoreVersionIssues' to disable this check. Please refer to Flexmojos maven doc. If you prefer fixing it instead of ignoring, take a look at: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:699) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:356) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoFailureException: Flex compiler and flex framework versions doesn't match. Compiler: '3.2.0.3958' - Framework: '4.1.0.16076'. You can use 'ignoreVersionIssues' to disable this check. Please refer to Flexmojos maven doc.

Not too sure why it is referring the compiler version as '3.2.0.3958' although I have defined the compiler version same as the "flex.sdk.version". My plugin looks like

       <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>  
            <version>${flex.mojo.version}</version>  
            <extensions>true</extensions>
            <configuration>
                <!--
                <linkReport>true</linkReport>
                <configurationReport>true</configurationReport>
                -->
                <locales>
                    <param>en_US</param>
                </locales>
                <sourcePaths>
                    <path>${project.build.sourceDirectory}</path>
                </sourcePaths>
                <contextRoot>${project.parent.artifactId}</contextRoot>
                <showWarnings>false</showWarnings>
                <debug>true</debug>
                <keepGeneratedActionscript>false</keepGeneratedActionscript>
                <incremental>true</incremental>
                <!-- <ignoreVersionIssues>true</ignoreVersionIssues> -->
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.adobe.flex</groupId>
                    <artifactId>compiler</artifactId>
                    <version>${flex.sdk.version}</version>
                    <type>pom</type>
                </dependency>
            </dependencies>
        </plugin>

Can anybody help??

A: 

Try this` http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0

<parent>
    <groupId>org.springframework.flex.samples</groupId>
    <artifactId>spring-flex-testdrive</artifactId>
    <version>1.0.3.RELEASE</version>
</parent>

<artifactId>collaboration</artifactId>
<packaging>swf</packaging>

<name>Collaboration Sample</name>

<build>
    <finalName>collaboration</finalName>
    <sourceDirectory>src/main/flex</sourceDirectory>
    <testSourceDirectory>src/test/flex</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <version>3.6.1</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <goals>
                  <goal>wrapper</goal>
                </goals>
              </execution>
            </executions>

            <configuration>
                <output>${basedir}/../testdrive/src/main/webapp/${project.build.finalName}/${project.build.finalName}.swf</output>
                <services>${basedir}/../testdrive/src/main/webapp/WEB-INF/flex/services-config.xml</services>
                <contextRoot>/testdrive</contextRoot>
                <locales>
                    <locale>en_US</locale>
                </locales>
                 <targetPlayer>10.0.0</targetPlayer> 
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.adobe.flex</groupId>
                    <artifactId>compiler</artifactId>
                    <version>4.0.0.14159</version>
                    <type>pom</type>
                </dependency>
            </dependencies>

        </plugin>
    </plugins>
</build>

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


    <!-- flexmojos Unit testing support -->
    <!--
        <dependency> <groupId>org.sonatype.flexmojos</groupId>
        <artifactId>flexmojos-unittest-support</artifactId>
        <version>3.2.0</version> <type>swc</type> <scope>test</scope>
        </dependency>
    -->
</dependencies>

`

Matt G. Madhavan
I tried changing based on your pom, but still no success..same error..Even when I run 'mvn dependency:tree', I don't find any reference to Compiler: '3.2.0.3958'
subh
A: 

Well, I spent the better part of a day trying to figure out the same thing. Finally, I ran across this:

Since flexmojos is an extension, it will be downloaded before the build start to allocate the swc/swf packaging support into memory.

I decided something else in the project (which is huge) was configuring flexmojo for flex4 (i was trying to build an old flex3 module) and i was getting this in-memory configured plugin. so, I found another flex3 component that was building correctly and changed my flexmojo version to match that one. It worked. It makes sense that maven would have to keep a in-memory instance of the plugin for every version of that plug-in.

So, try changing your flexmojo version number (I changed from 1.6.1 to 1.5.0)

Thanks