1

I'm migrating an application I had working with Adobe Flex 4.6 and FlexMojos 4 to Apache Flex 4.14 and FlexMojos 7. When I try to execute "mvn build" I'm getting this error:

[ERROR]     Unresolveable build extension: Plugin net.flexmojos.oss:flexmojos-maven-plugin:7.0.1 or one of its dependencies could not be resolved:
The following artifacts could not be resolved:
org.apache.flex.compiler:mxmlc:jar:4.12.1.20140427, 
org.apache.flex.compiler:digest:jar:4.12.1.20140427, 
org.apache.flex.compiler:optimizer:jar:4.12.1.20140427, 
org.apache.flex.compiler:asdoc:jar:4.12.1.20140427, 
org.apache.flex.compiler:swcdepends:jar:4.12.1.20140427, 
org.apache.flex:compiler:pom:4.12.1.20140427: Failure to find 
org.apache.flex.compiler:mxmlc:jar:4.12.1.20140427 in 
http://repository.sonatype.org/content/groups/flexgroup/ was cached in the local repository, resolution will not be reattempted until the update interval of flex-mojos-repository has elapsed or updates are forced -> [Help 2]
[ERROR]     Unknown packaging: swf @ line 5, column 13

This is my pom.xml:

<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>
    <groupId>com.cognifit.cognifitSocialFlex</groupId>
    <artifactId>FlexCognifit</artifactId>
    <packaging>swf</packaging>
    <name>cognifitSocialFlex</name>
    <version>11.0.2.10</version>

    <properties>
        <flex.version>4.14.1.20150325</flex.version>
        <flashplayer.version>11.1</flashplayer.version>
    </properties>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <directory>${project.basedir}/target/${project.version}</directory>
        <plugins>
            <plugin>
                <groupId>net.flexmojos.oss</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>7.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <sourceFile>CpcSocialFlex.mxml</sourceFile>
                    <swfVersion>13</swfVersion>
                    <targetPlayer>11.1.0</targetPlayer>

                    <localesCompiled>
                        <locale>ar_MA</locale>
                        <locale>de_AT</locale>
                        <locale>de_CH</locale>
                        <locale>de_DE</locale>
                        <locale>el_GR</locale>
                        <locale>en_US</locale>
                        <locale>en_ZA</locale>
                        <locale>es_ES</locale>
                        <locale>es_MX</locale>
                        <locale>fr_FR</locale>
                        <locale>he_IL</locale>
                        <locale>it_IT</locale>
                        <locale>ja_JP</locale>
                        <locale>ko_KR</locale>
                        <locale>nl_NL</locale>
                        <locale>pt_BR</locale>
                        <locale>pt_PT</locale>
                        <locale>ru_RU</locale>
                        <locale>sr_RS</locale>
                        <locale>tr_TR</locale>
                        <locale>zh_CN</locale>
                        <locale>zh_HK</locale>
                    </localesCompiled>

                    <dependencies>
                        <dependency>
                            <groupId>org.apache.flex</groupId>
                            <artifactId>compiler</artifactId>
                            <version>${flex.version}</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.flex</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.version}</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flash.framework</groupId>
            <artifactId>playerglobal</artifactId>
            <version>${flashplayer.version}</version>
            <type>swc</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flex.framework.themes</groupId>
            <artifactId>halo</artifactId>
            <type>swc</type>
            <scope>theme</scope>
            <version>${flex.version}</version>
        </dependency>
    </dependencies>
</project>

I'm using Maven 3.2.5 and Java 1.6.0_14:

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T12:29:23-05:00)
Maven home: /usr/local/maven
Java version: 1.6.0_14, vendor: Sun Microsystems Inc.
Java home: /usr/java/jdk1.6.0_14/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.21.7-2.fc8xen", arch: "i386", family: "unix"

These are the steps I have followed:

I downloaded the Apache Flex SDK with the Installer:

  • Apache Flex SDK 4.14.1
  • AIR 18.0
  • Flash Player 18

enter image description here

I have used the Mavenizer to create a Maven version of this SDK:

enter image description here

Then I have deployed the mavenized version in my /root/.m2/repository/ folder and executed mvn compile with the pom.xml.

Jose Ignacio Hita
  • 874
  • 1
  • 10
  • 17
  • I have been working hard on Flexmojos and the Converter in the last weeks, so could you please check if: a) The version generated is 4-segment ... new versions should only generate 3 segment versions "4.12.1" b) Did you switch to the develop branch of the sdk converter? c) Did you have a look at the documentation I wrote recently? https://cwiki.apache.org/confluence/display/FLEX/Building+Flex+applications+with+Maven – Christofer Dutz Aug 17 '15 at 11:25
  • Thanks for asking, I have abandoned FlexMojos since I thought the project was discontinued. If I type "FlexMojos" in Google, the first result takes me to the documentation and the docs for the latest version are empty: https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/Flexmojos+7.x – Jose Ignacio Hita Aug 18 '15 at 10:03
  • Well I'm the only one actually working on it and I the Atlassian page did have a lot of issues with permissions, so I started re-writing the documentation on the Apache Flex Wiki. The original Author dropped the google mailinglist and I moved support to the Apache Flex mailinglists. Version 7.1.0 (Still SNAPSHOT) is already full of cool features. May I ask what you are using instead? – Christofer Dutz Aug 18 '15 at 10:42
  • Direct compilation using Unix scripts calling mxmlc directly from the Apache SDK. Thanks for your effort! Why Adobe is not using more resources on this? They are not helping Flex to resist... – Jose Ignacio Hita Aug 18 '15 at 10:47
  • Well Adobe is going a different path now. That's why they donated Flex to Apache in the first place ... we are happy that they are giving the project at least one full-time-developer to work on Flex for free, so that's a big help. So If you want to give Flexmojos another try, I'd be happy to assist you. – Christofer Dutz Aug 18 '15 at 11:52
  • @ChristoferDutz I'm having trouble getting this to work, too. Where can I get the 7.1.0-SNAPSHOT? Should this work with Flex 3.4 or can I stop trying? – amiuhle Aug 27 '15 at 09:56
  • Flexmojos 7.1.0-SNAPSHOT is for Apache Flex especially the Maven structures created by the apache-flex-sdk-converter ... I think with Flex 3.4 you are stuck with a really really old version of Flexmojos ... have a look at this documentation here: https://cwiki.apache.org/confluence/display/FLEX/Building+Flex+applications+with+Maven – Christofer Dutz Aug 27 '15 at 11:13

1 Answers1

0

By the way in the meanwhile the mavenizer has evolved quite a bit ... making usage of maven extensions by ".mvn/extensions.xml" files. This should automatically download, convert and install the Flex/Flash/Air resources you reference. So to upgrade to the next Flex/Flash/Air version, just reference a new version and the plugin will take care of the rest (As long as the version actually exists). See more details here: https://cwiki.apache.org/confluence/display/FLEX/Preparing+FDKs+for+Maven+builds (Pay some special attention to the chapter: Prepare the FDK resources using the flex-sdk-converter-maven-extension)

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34