mavenapache-flexinternationalizationflexmojosflex-mojos

Flexmojo compiledLocal failed for italian or serbian language


I discover flex world and maven by adding some new feature in an existing flex app, I may certainly doing something wrong but i don't know what. I'm using flexmojo to manage flex compilation and I got some error when I try to activate another languages (spanich, italian or serbian). It work like a charm for french german and english language

Here is my pom.xml :

<configuration>
    <targetPlayer>10.0.0</targetPlayer>
    <incremental>true</incremental>
    <verboseStacktraces>false</verboseStacktraces>
    <optimize>true</optimize>
    <showWarnings>false</showWarnings>
    <debug>false</debug>
    <strict>true</strict>
    <compiledLocales>
        <locale>fr_FR</locale>
        <locale>es_ES</locale>
        <locale>de_DE</locale>
        <locale>it_IT</locale>
        <locale>en_US</locale>
        <locale>rs_SR</locale>
    </compiledLocales>
    <themes>
        <theme>${project.build.directory}/generated-resources/flex/themes/spark-theme.css</theme> 
        <theme>${project.build.directory}/generated-resources/flex/themes/halo-theme.swc</theme>
    </themes> 
    <!-- il faut indiquer ou est le fichier services-config.xml -->
    <services>${project.build.directory}/generated-resources/flex/services-config.xml</services>
    <!-- url context de l'application java qui sera appelee-->
    <contextRoot>idApp</contextRoot>
    <useNetwork>true</useNetwork>
    <allowSourcePathOverlap>true</allowSourcePathOverlap>
    <sourcePaths>
        <path>${basedir}/src/main/resources/locale/{locale}</path>
        <path>${basedir}/src/main/flex/</path>
        <path>${basedir}/src/test/</path>
    </sourcePaths>
    <sourceFile>idApp.mxml</sourceFile>
    <skipTests>true</skipTests>
</configuration>

In my config.xml file I have the same language :

<?xml version="1.0" encoding="UTF-8"?>
<IDTRELConfig>
    <service endpoint="http://localhost:8080/idApp/messagebroker/amf" />
    <languages>
        <fr enable="true" />
        <en enable="true" />
        <es enable="true" />
        <de enable="true" />
        <it enable="true" />
        <sr enable="true" />
    </languages>
</IDTRELConfig>

When I execute within eclispe the following command :

clean install -Dmaven.test.skip -Dmaven.javadoc.skip

I got the following error :

    ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.200 s
[INFO] Finished at: 2015-03-11T18:24:45+01:00
[INFO] Final Memory: 15M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project idApp: Failure to find com.adobe.flex.framework:datavisualization:rb.swc:rs_SR:4.1.0.16076 in http://download.java.net/maven/2 was cached in the local repository, resolution will not be reattempted until the update interval of java.net2 has elapsed or updates are forced
[ERROR] 
[ERROR] Try downloading the file manually from the project website.

Solution

  • Please use a locale chain. The problem is that you are defining a language the flex-framework doesn't have locales for per default. So the compiler complains as soon as it wants to include the serbian locales for the flex resource-bundes. The simplest solution would be to set english as a fallback for any resources not avaialbe in serbian.

    <compiledLocales>
        <locale>fr_FR</locale>
        <locale>es_ES</locale>
        <locale>de_DE</locale>
        <locale>it_IT</locale>
        <locale>en_US</locale>
        <locale>rs_SR,en_US</locale>
    </compiledLocales>
    

    This way the compiler will use Serbian where you have provided it, and use US-English wherever you are missing a Serbian resource.

    See here for details: https://cwiki.apache.org/confluence/display/FLEX/Adding+I18N+support+to+your+application for details