Share & Learn

Monday, August 11, 2008

Building a swc using a net.israfil.mojo plugin with resource bundle

This one was pending for long now. Many of my friends has this issue prop up everytime they had resource bundle in their project.

Problem Statement: Get 'Error: resource bundle not found <resoucebundlename>.<properties>' when doing a build with the pom.xml. Building a swc using a net.israfil.mojo plugin.

Solution: Just copy paste the following xml into your pom. Ensure that you have useNetwork=false set as at times it does not refer to local file system if you don't have this attribute set to false.


<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.priyank.samples.mx.ascomponent</groupId>
<artifactId>ascomponent</artifactId>
<version>1.0</version>
<name>ascomponent</name>
<packaging>swc</packaging>
<properties>
<flex.home>${env.FLEX_HOME}</flex.home>
<flex.compiler.source>src</flex.compiler.source>
<flex.priyank.locale>en_US</flex.priyank.locale>
</properties>
<build>
<finalName>ascomponent</finalName>
<plugins>
<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<version>1.0</version>
<extensions>true</extensions>
<configuration>
<flexHome>${flex.home}</flexHome>
<useNetwork>false</useNetwork>
<extraParameters>
<parameter>
<name>source-path+=${basedir}/src/main/locale/$
{flex.priyank.locale}</name>
</parameter>
</extraParameters>
</configuration>
</plugin>
</plugins>
<outputDirectory>build</outputDirectory>
</build>
<dependencies>
<dependency>
<groupId>com.adobe</groupId>
<artifactId>cairngorm</artifactId>
<version>2.2.1</version>
<type>swc</type>
</dependency>
</dependencies>
</project>

This should generate an SWC artifact under the target directory. The typical developer shrug, "It works on my machine" is not applicable here.

blog comments powered by Disqus
blog comments powered by Disqus