building maven flex project with flex mojo depending on apache sdk fail

1.4k views Asked by At

I have a mavenized flex project wich builds fine with adobe sdke 4.6. Now , i'm trying to compile it with apache recent sdk . I mavenized the sdk and copied the dependencies in local repo . the apache version that i mavenized is : 4.13.0.20140701 .

my pom is as below :

<properties>
        <flexmojos.version>7.0.1</flexmojos.version>
        <flex.version>4.13.0.20140701</flex.version>
        <flash.version>11.1</flash.version>
    </properties>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>

        <plugins>
            <plugin>
                <groupId>net.flexmojos.oss</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>${flexmojos.version}</version>
                <extensions>true</extensions>

                <configuration>
                    <debug>true</debug>
                    <sourceFile>ComptaFlex.mxml</sourceFile>
                    <services>${basedir}/src/main/flex/services/services-config.xml</services>
                    <compilerWarnings>
                        <warn-no-constructor>false</warn-no-constructor>
                    </compilerWarnings>
                </configuration>
                <dependencies>
                    <!-- This handles a bug in maven which causes problems with flex resources -->
                    <dependency>
                        <groupId>net.flexmojos.oss</groupId>
                        <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
                        <version>${flexmojos.version}</version>
                    </dependency>
                    <!-- Without this FM will use the compiler configured in its master 
                        pom, which will result in version conflicts -->
                    <dependency>
                        <groupId>org.apache.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.13.0.20140701</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>

I got maven compile error as :

xmojos.oss:flexmojos-flex-compiler:jar:7.0.1 -> net.flexmojos.oss:flexmojos-generator-internal-compiler-iface:jar:7.0.1 -> org.apache.flex:compiler:pom:4.12.1.20140427: Failed to read artifact descriptor for org.apache.flex:compiler:pom:4.12.1.20140427: Could not transfer artifact org.apache.

it seems that flex mojo always use a default apache version and ignores mine provided . how could i force flexmojo build with my given version .

3

There are 3 answers

9
Sami Jmii On

A dirty work around is to change flexmojo-parent pom file : and edit by hand :

<flex.version>4.13.0.20140701</flex.version>

until flexmojo developpers comes with a better response .

0
Vasyl Boyko On

Flexmojos-maven-plugin version 7.0.x is built using FDK 4.12.1.20140427. This FDK declared as dependency to this maven plugin. You need firstly mavenize FDK 4.12.1.20140427 and put it to you maven repository. Only after that you can mavenize other versions of FDK.

0
Christofer Dutz On

I have written quite a bit of documentation lately, please check-out at: https://cwiki.apache.org/confluence/display/FLEX/Preparing+FDKs+for+Maven+builds

The short version: We have created a maven extension that should automatically download and install Flex SDKs as they are referenced in the maven build. Also Flexmojos 7.1.0-SNAPSHOT has been updated to no longer contain a reference to any FDK artifact. Also we now use 3-segment versions such as: 4.14.1