What is flex-mojos?
A collection of maven plugins to allow maven to compile, optimize, test and ... Flex SWF, Flex SWC, Air SWF and Air SWC.The main goal is to provide a full support to all mxmlc/compc options. Also here is post from the author on why he wrote it. Flex Mojos WhyFirst we want to add the flex dependencies to maven to our local repository, or your remote repository. Download the flex sdk from here - Flex 3 SDK . Follow the instructions here Install Adob SDK Mojo .
In the root project add the flex mojos repository
<repositories>
<repository>
<id>flex-mojos-repository</id>
<url>http://svn.sonatype.org/flexmojos/repository/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
Now we want to add pluginRepository next which is identical to repository
<pluginRepositories>
<pluginRepository>
<id>flex-mojos-repository</id>
<url>
http://svn.sonatype.org/flexmojos/repository/
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
under build we add plugins - plugin
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Now in the flex module under dependency all that is needed to handle all flex dependencies is this :
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>3.0.3.2490</version>
<type>pom</type>
</dependency>
</dependencie
Now under build of the pom ..
<build>
<sourceDirectory>src/main/flex/</sourceDirectory>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>info.flex-mojos</groupId>
<artifactId>flex-compiler-mojo</artifactId>
<version>2.0M5</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.0.3.2490</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<locales>
<param>en_US</param>
</locales>
</configuration>
</plugin>
</plugins>
</build>
Thats it...
Anytime you want to upgrade to a newer version of the sdk , just install and change version numbers. Super simple.
run mvn install , and everything should be good.
No comments:
Post a Comment