以前寫了flashbulid、initellij下的flex國際化配置,它們都是在本地打包發佈的,那麼咱們的工程用maven管理了,須要自動發佈。這時候如何修改flex的pom文件,來讓它build的時候支持國際化呢?dom
同理,咱們須要在Maven build flex的插件配置標籤裏配置國際化支持,看代碼:maven
<build> <finalName>FlexI18nTest</finalName> <sourceDirectory>src</sourceDirectory> <outputDirectory>./out</outputDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <configuration> <sourceFile>FlexI18nTest.mxml</sourceFile> <outputDirectory>./out</outputDirectory> <localesSourcePath> ${basedir}/locale/{locale} </localesSourcePath> <localesCompiled> <locale>en_US</locale> <locale>zh_CN</locale> </localesCompiled> <policyFileUrls> <!--- cross domain policy for each RSL entry --> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> </policyFileUrls> <rslUrls> <url> http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_{version}.{extension} </url> <url> http://fpdownload.adobe.com/pub/{extension}/tlf/${flex.tlf.version}/{artifactId}_${flex.tlf.version}.{extension} </url> <url> http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_${flex.osmf.version}.{extension} </url> </rslUrls> <debug>true</debug> <swfVersion>11</swfVersion> <targetPlayer>10.2</targetPlayer> <storepass/> <optimize>true</optimize> <showWarnings>true</showWarnings> <allowSourcePathOverlap>true</allowSourcePathOverlap> </configuration> </plugin> </plugins> </build>
Flexmojos 版本號:4.0-RC2 flex
Maven版本號:4.0.0ui
我添加了兩種語言支持 ,中文和英文。url
<localesSourcePath> ${basedir}/locale/{locale} </localesSourcePath> spa
<localesCompiled> <locale>en_US</locale> <locale>zh_CN</locale> </localesCompiled>插件