Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 如何在flexmojos4.x中构建flex资源模块_Apache Flex_Resourcebundle_Flexmojos - Fatal编程技术网

Apache flex 如何在flexmojos4.x中构建flex资源模块

Apache flex 如何在flexmojos4.x中构建flex资源模块,apache-flex,resourcebundle,flexmojos,Apache Flex,Resourcebundle,Flexmojos,我使用flexmojos插件来管理我的flex应用程序。首先,我使用flexmojos3.8,下面是创建独立资源模块的片段。如果我的应用程序支持en_US,zh_Ch,我可以获得MainApp_en_US.swf和MainApp_zh_CN.swf。在我的应用程序中,我可以根据浏览器的语言加载适当的资源模块 <plugin> <groupId>org.sonatype.flexmojos</groupId>

我使用flexmojos插件来管理我的flex应用程序。首先,我使用flexmojos3.8,下面是创建独立资源模块的片段。如果我的应用程序支持en_US,zh_Ch,我可以获得MainApp_en_US.swf和MainApp_zh_CN.swf。在我的应用程序中,我可以根据浏览器的语言加载适当的资源模块

      <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <dependencies>
               <dependency>
                  <groupId>com.adobe.flex</groupId>
                  <artifactId>compiler</artifactId>
                  <version>${flex.sdk.version}</version>
                  <type>pom</type>
               </dependency>
            </dependencies>

            <configuration>
               <sourceFile>MainApp.mxml</sourceFile>
               <resourceBundlePath>
                    src/main/flex/locale/{locale}
               </resourceBundlePath>

               <runtimeLocales>${locales}</runtimeLocales>
               <mergeResourceBundle>false</mergeResourceBundle>
               <runtimeLocaleOutputPath>
                  /{contextRoot}/MainApp_{locale}.{extension}
               </runtimeLocaleOutputPath>

               <rslUrls>
                  <url>/{contextRoot}/rsl/{artifactId}.{extension}</url>
               </rslUrls>
            </configuration>
         </plugin>
               <localesRuntime>
                  <locale>en_US</locale>
                  <locale>fr_FR</locale>
                  <locale>zh_CN</locale>
               </localesRuntime>
               //Output resource module to current pathe (/target)
               <localesOutputPath>
                  /
               </localesOutputPath>
               //Define your resource moudle name pattern
               <resourceBundleNames>
       MainApp_{locale}
         </resourceBundleNames> 
             .....
            </configuration>
但是当我升级flexmojos 4.0-RC2时,我发现变化很大。配置更改为 ..... MainApp.mxml src/main/flex/locale/{locale}

               <localesRuntime>
                  <locale>en_US</locale>
                  <locale>fr_FR</locale>
                  <locale>zh_CN</locale>
               </localesRuntime>
               //Output resource module to current pathe (/target)
               <localesOutputPath>
                  /
               </localesOutputPath>
               //Define your resource moudle name pattern
               <resourceBundleNames>
       MainApp_{locale}
         </resourceBundleNames> 
             .....
            </configuration>
经过多次尝试后,它仍然有效。最后一个配置如上面所示

               <localesRuntime>
                  <locale>en_US</locale>
                  <locale>fr_FR</locale>
                  <locale>zh_CN</locale>
               </localesRuntime>
               //Output resource module to current pathe (/target)
               <localesOutputPath>
                  /
               </localesOutputPath>
               //Define your resource moudle name pattern
               <resourceBundleNames>
       MainApp_{locale}
         </resourceBundleNames> 
             .....
            </configuration>