qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

overriding locale=en_US and mergeResourceBundle=true are not friends #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile any project with resources using this pom:
<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>

    <parent>
        <groupId>info.rvin.mojo</groupId>
        <artifactId>flex-super-pom</artifactId>
        <version>1.0</version>
    </parent>

    <groupId>whather</groupId>
    <artifactId>resource</artifactId>
    <version>1-SNAPSHOT</version>
    <name>test</name>

    <packaging>swf</packaging>
    <build>
        <plugins>
            <plugin>
                <groupId>info.rvin.mojo</groupId>
                <artifactId>flex-compiler-mojo</artifactId>
                <configuration>
                    <locales>
                        <locale>en_US</locale>
                    </locales>
                    <mergeResourceBundle>true</mergeResourceBundle>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

What do you see instead?
- many errors like: [ERROR]
datavisualization\3.0.0.477\datavisualization-3.0.0.477-en_US.swc$locale/en_US/c
ore.properties:[40,14]
Duplicate class definition: en_US$core_properties.public class
en_US$core_properties extends ResourceBundle

- compiler.source-path has got twice the path to src\main\locales\en_US 

Original issue reported on code.google.com by marcsp...@gmail.com on 15 Jul 2008 at 11:42

GoogleCodeExporter commented 9 years ago
Don't get the problem.

What do you mean?

VELO

Original comment by velo...@gmail.com on 15 Jul 2008 at 12:02

GoogleCodeExporter commented 9 years ago
1. Create an application in src/main/flex/App.mxml:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Text text="hello world" />  
</mx:Application>

2. Create a resource in src/main/locales/en_Us/foo.properties:
hello = hello

3. run the pom.xml above and you get about 8 duplicate errors.

4. When you check out the compiler options, you see:
-compiler.source-path c:\Base\src\main\flex c:\Base\src\main\locales\en_US
c:\Base\src\main\locales\en_US

I would think that adding twice the path to locales causes the duplicate errors.

Original comment by marcsp...@gmail.com on 15 Jul 2008 at 12:12

GoogleCodeExporter commented 9 years ago
Well,

What happened.

The locale is defined on flex-super-pom:
<locales>
    <param>en_US</param>
</locales>

Then, you define it again on your pom:
<locales>
    <locale>en_US</locale>
</locales>

Maven will merged both locales.  So, you will have one en_US for flex-super-pom 
and
another en_US for your pom.xml:
<locales>
    <locale>en_US</locale>
    <param>en_US</param>
</locales>

You can confirm that running mvn help:effective-pom

I changed flex-super-pom to locale.

Original comment by velo...@gmail.com on 18 Jul 2008 at 1:34