<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2082410934238367796</atom:id><lastBuildDate>Sun, 27 Nov 2011 23:31:38 +0000</lastBuildDate><title>Flex-mojos 3.2.0 + Flash Player 10 + Flex SDK 3.4</title><description>This is a blog for people trying to accomplish the same goals that I have been trying for the last couple of days. To use flexmojos with flash player 10 and flex sdk 3.4</description><link>http://flexmojos.blogspot.com/</link><managingEditor>noreply@blogger.com (Leonardo Varela)</managingEditor><generator>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Flex-mojos320FlashPlayer10FlexSdk34" /><feedburner:info uri="flex-mojos320flashplayer10flexsdk34" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2082410934238367796.post-3663560630730884732</guid><pubDate>Thu, 22 Oct 2009 05:23:00 +0000</pubDate><atom:updated>2009-10-24T00:00:21.661-07:00</atom:updated><title>Creating a Flex application with Maven that support Flash Player 10 and Flex SDK 3.4</title><description>Hello all,&lt;br /&gt;
&lt;br /&gt;
I have been playing with Flex-mojos plugin (Thanks VELO) for two to three days, reading the recommended book(maven definite guide), etc. &lt;br /&gt;
&lt;br /&gt;
I had come to LOOOOTS of old misleading blogs(which I'm sure this one will become!).&lt;br /&gt;
So First thing I want to say is that the day I wrote this article was &lt;span style="color: red; font-style: italic; font-weight: bold;"&gt;OCTOBER 21, 2009&lt;/span&gt;&lt;br /&gt;
I'm using:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Flex-mojos 3.2.0&lt;/li&gt;
&lt;li&gt;Flash Player 10&lt;/li&gt;
&lt;li&gt;Flex SDK 3.4&lt;/li&gt;
&lt;li&gt;RSL and caching capabilities to reduce swf/swc file sizes.&lt;/li&gt;
&lt;/ul&gt;My approach is to provide you with the pom files and a Step by Step Guide to build the project.&lt;br /&gt;
&lt;br /&gt;
Before getting into the code, I'm going to summarize what I am going to accomplish:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;A top level project that will have three modules:&lt;/li&gt;
&lt;ol&gt;&lt;li&gt;An RSL project that has only flex framework dependencies. (TopLevelLibrary)&lt;/li&gt;
&lt;li&gt;An RSL project that will depend on the TopLevelLibrary project. (MidLevelLibrary)&lt;/li&gt;
&lt;li&gt;An application that will use a component from the MidLevelLibrary project. (Flex-app)&lt;/li&gt;
&lt;/ol&gt;&lt;/ol&gt;Both RSL will be optimized to reduce the size of the application and to have the RSL load faster.&lt;br /&gt;
My Box is a Windows Vista. so I will create the project on C:\blog\examples\multi-level-flex-maven and I will call it &lt;b&gt;PROJECT_HOME.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Create the top level pom that will contain the three modules specified before in the folder &lt;b&gt;PROJECT_HOME&lt;/b&gt;. As follows&lt;/li&gt;
&lt;pre class="xml" name="code"&gt;&lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelversion&gt;4.0.0&lt;/modelversion&gt;

  &lt;parent&gt;
    &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupid&gt;
    &lt;artifactid&gt;flexmojos-flex-super-pom&lt;/artifactid&gt;
    &lt;version&gt;3.2.0&lt;/version&gt;
  &lt;/parent&gt;

  &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupid&gt;
  &lt;artifactid&gt;multi-level-flex-maven&lt;/artifactid&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;

  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;name&gt;Parent Project Multi Level Flex Maven&lt;/name&gt;
  &lt;url&gt;http://www.leonardovarela.com&lt;/url&gt;
  &lt;organization&gt;
    &lt;name&gt;Leonardo Varela&lt;/name&gt;
    &lt;url&gt;http://www.leonardovarela.com&lt;/url&gt;
  &lt;/organization&gt;
  &lt;developers&gt;
    &lt;developer&gt;
      &lt;id&gt;leonardo.varela&lt;/id&gt;
      &lt;name&gt;Leonardo Varela&lt;/name&gt;
      &lt;email&gt;leonardovarela@gmail.com&lt;/email&gt;
      &lt;url&gt;http://www.leonardovarela.com&lt;/url&gt;
      &lt;organization&gt;Leonardo Varela&lt;/organization&gt;
      &lt;organizationurl&gt;http://www.leonardovarela.com&lt;/organizationurl&gt;
      &lt;roles&gt;
        &lt;role&gt;Researcher&lt;/role&gt;
        &lt;role&gt;Blogger&lt;/role&gt;
        &lt;role&gt;Developer&lt;/role&gt;
        &lt;role&gt;Freelancer&lt;/role&gt;
   &lt;/roles&gt;
      &lt;timezone&gt;-8&lt;/timezone&gt;
    &lt;/developer&gt;
  &lt;/developers&gt;
  
  &lt;properties&gt;
    &lt;flex.version&gt;3.4.0.9271&lt;/flex.version&gt;
    &lt;flexmojos.version&gt;3.2.0&lt;/flexmojos.version&gt;
    &lt;flash.version&gt;10.0.0&lt;/flash.version&gt;
    &lt;flash.player.classifier&gt;10&lt;/flash.player.classifier&gt;
    &lt;build.finalname&gt;Flex-Maven-RSL&lt;/build.finalname&gt;
  &lt;/properties&gt; 

  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupid&gt;
        &lt;artifactid&gt;flexmojos-maven-plugin&lt;/artifactid&gt;
        &lt;version&gt;${flexmojos.version}&lt;/version&gt;
        &lt;configuration&gt;
          &lt;debug&gt;true&lt;/debug&gt;
          &lt;rslurls&gt;
            &lt;rsl&gt;{artifactId}-{version}.{extension}&lt;/rsl&gt;
          &lt;/rslurls&gt;
          &lt;targetplayer&gt;${flash.version}&lt;/targetplayer&gt;
        &lt;/configuration&gt;
        &lt;dependencies&gt;
   &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex&lt;/groupid&gt;
      &lt;artifactid&gt;compiler&lt;/artifactid&gt;
      &lt;version&gt;${flex.version}&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
   &lt;/dependency&gt;
 &lt;/dependencies&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
    &lt;pluginmanagement&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupid&gt;org.apache.maven.plugins&lt;/groupid&gt;
          &lt;artifactid&gt;maven-dependency-plugin&lt;/artifactid&gt;
          &lt;version&gt;2.0&lt;/version&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/pluginmanagement&gt;
  &lt;/build&gt;

  
  &lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;flex-mojos-repository&lt;/id&gt;
      &lt;url&gt;http://repository.sonatype.org/content/groups/public&lt;/url&gt;
        &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt;
                    &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt; 
    &lt;/repository&gt;
    &lt;repository&gt;
      &lt;id&gt;flex-mojos-repository2&lt;/id&gt;
      &lt;url&gt;http://repository.sonatype.org/content/repositories/all-004/&lt;/url&gt;
        &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt;
        &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt; 
    &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginrepositories&gt;
    &lt;pluginrepository&gt;
      &lt;id&gt;flex-mojos-repository&lt;/id&gt;
      &lt;url&gt;http://repository.sonatype.org/content/groups/public&lt;/url&gt;
        &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt;
                    &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt; 
    &lt;/pluginrepository&gt;
  &lt;/pluginrepositories&gt;
  
  &lt;modules&gt;
    &lt;module&gt;TopLevelLibrary&lt;/module&gt;
    &lt;module&gt;MidLevelLibrary&lt;/module&gt;
    &lt;module&gt;Flex-app&lt;/module&gt;
  &lt;/modules&gt;
&lt;/project&gt;
&lt;/pre&gt;We are defining the properties in the &lt;properties&gt; tag for the whole project, we are setting up flex-mojos 3.2 as a super pom(parent) for this project. The coordinates for this project are:  &lt;/properties&gt;   &lt;ol&gt;&lt;li&gt;groupid: com.leonardovarela.blog.examples&lt;/li&gt;
&lt;li&gt;artifactid: multi-level-flex-maven&lt;/li&gt;
&lt;li&gt;version: 1.0-SNAPSHOT&lt;/li&gt;
&lt;/ol&gt;We are defining the repositories and the plugin repositories: Make sure to include http://repository.sonatype.org/content/repositories/all-004/ which is the repository with the 3.4 version of Flex.
&lt;li&gt; Create the folder structure for your project:&lt;/li&gt;
&lt;ol&gt;&lt;li&gt;PROJECT_HOME/TopLevelLibrary&lt;/li&gt;
&lt;li&gt;PROJECT_HOME/MidLevelLibrary&lt;/li&gt;
&lt;li&gt;PROJECT_HOME/Flex-app&lt;/li&gt;
&lt;/ol&gt;&lt;li&gt;Lets Create the Library projects.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt; TopLevelLibrary project setup&lt;br /&gt;
Inside the directory&amp;nbsp;PROJECT_HOME/TopLevelLibrary create a pom file that we will use to build the optimized RSL with no dependencies. The pom should look like this:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelversion&gt;4.0.0&lt;/modelversion&gt;

  &lt;parent&gt;
    &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupid&gt;
    &lt;artifactid&gt;multi-level-flex-maven&lt;/artifactid&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;

  &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupid&gt;
  &lt;artifactid&gt;TopLevelLibrary&lt;/artifactid&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;

  &lt;packaging&gt;swc&lt;/packaging&gt;

  &lt;dependencies&gt;
  &lt;dependency&gt;
        &lt;groupid&gt;com.adobe.flex.framework&lt;/groupid&gt;
        &lt;artifactid&gt;framework&lt;/artifactid&gt;
        &lt;version&gt;${project.flex.version}&lt;/version&gt;
        &lt;type&gt;swc&lt;/type&gt;
        &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupid&gt;com.adobe.flex.framework&lt;/groupid&gt;
    &lt;artifactid&gt;flex-framework&lt;/artifactid&gt;
    &lt;version&gt;${project.flex.version}&lt;/version&gt;
    &lt;type&gt;pom&lt;/type&gt;
    &lt;exclusions&gt;
      &lt;exclusion&gt;
        &lt;groupid&gt;com.adobe.flex.framework&lt;/groupid&gt;
        &lt;artifactid&gt;playerglobal&lt;/artifactid&gt;
      &lt;/exclusion&gt;
    &lt;/exclusions&gt;
    &lt;scope&gt;external&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupid&gt;com.adobe.flex.framework&lt;/groupid&gt;
    &lt;artifactid&gt;playerglobal&lt;/artifactid&gt;
    &lt;version&gt;${project.flex.version}&lt;/version&gt;
    &lt;classifier&gt;${project.flash.player.classifier}&lt;/classifier&gt;
    &lt;type&gt;swc&lt;/type&gt;
    &lt;scope&gt;external&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupid&gt;
    &lt;artifactid&gt;flexmojos-unittest-support&lt;/artifactid&gt;
    &lt;version&gt;${project.flexmojos.version}&lt;/version&gt;
    &lt;type&gt;swc&lt;/type&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
 &lt;/dependencies&gt;
 &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupid&gt;
        &lt;artifactid&gt;flexmojos-maven-plugin&lt;/artifactid&gt;
        &lt;configuration&gt;
          &lt;debug&gt;true&lt;/debug&gt;
          &lt;rslurls&gt;
            &lt;rsl&gt;{artifactId}-{version}.{extension}&lt;/rsl&gt;
          &lt;/rslurls&gt;
          &lt;targetplayer&gt;${project.flash.version}&lt;/targetplayer&gt;
        &lt;/configuration&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;goals&gt;
              &lt;goal&gt;optimize&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  
&lt;/project&gt;

&lt;/pre&gt;Please notice that the scope of the dependencies is External which will reduce the size of your RSL a LOT! Also notice the execution goal 'optimize'. Also understand that I am excluding playerglobal from flex-framework because by default it uses Flash Player 9, this is how we are supporting Flash Player 10!!!  Now we need to add some code to the library! Here's what I'm sure you know how to do! But we will add some sample classes just to test.&lt;br /&gt;
Now that we have defined the pom file lets create the default project structure either with a maven archetype or from your existing sources.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;PROJECT_HOME/TopLevelLibrary/src/main/flex/com/leonardovarela/blog/examples/toplevellibrary&lt;/li&gt;
&lt;li&gt;PROJECT_HOME/TopLevelLibrary/src/main/test/com/leonardovarela/blog/examples/toplevellibrary&lt;/li&gt;
&lt;li&gt;Add the following component(TopLevelLibraryComponent.mxml) to the package com.leonardovarela.blog.examples.toplevellibrary (Please note that the syntax highlighter removes the casing so please make box-&gt;Box, label-&gt;Label, image-&gt;Image and don't forget the &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; at the beginning of the mxml file):&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Box xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
  &lt;mx:Label text="America is the best soccer team WORLDWIDE!"/&gt;
  &lt;mx:Image id="americaTheBestSoccerTeamEver" source="@Embed('America.jpg')"/&gt;
&lt;/mx:Box&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Get the image: &lt;a href="http://leonardovarela.com/blog/examples/multi-level-flex-maven/America.jpg"&gt;America&lt;/a&gt; and place it on the same folder of the component (PROJECT_HOME/TopLevelLibrary/com/leonardovarela/blog/examples/toplevellibrary)&lt;/li&gt;
&lt;li&gt; You are all set for the top level library&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;Now lets add another RSL that depends on the TopLevelLibraryProject.&lt;br /&gt;
For that lets create another porject folder structure and another pom file.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;The project will be named MidLevelLibrary and its location will be: PROJECT_HOME/MidLevelLibrary so create that folder and inside a package structure similar to the last project:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;PROJECT_HOME/MidLevelLibrary/src/main/flex/com/leonardovarela/blog/examples/midlevellibrary&lt;/li&gt;
&lt;li&gt;PROJECT_HOME/MidLevelLibrary/src/main/test/com/leonardovarela/blog/examples/midlevellibrary&lt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Now lets create the pom file for the MidLevelLibrary that uses the component of the TopLevelLibrary: The file should be like this:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;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"&gt;
  &lt;modelversion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
    &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
    &lt;artifactid&gt;multi-level-flex-maven&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
  &lt;artifactid&gt;MidLevelLibrary&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;swc&lt;/packaging&gt;
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
      &lt;artifactid&gt;TopLevelLibrary&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;framework&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;flex-framework&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
          &lt;artifactid&gt;playerglobal&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;playerglobal&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;classifier&gt;${project.flash.player.classifier}&lt;/classifier&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupId&gt;
      &lt;artifactid&gt;flexmojos-unittest-support&lt;/artifactId&gt;
      &lt;version&gt;${project.flexmojos.version}&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupId&gt;
        &lt;artifactid&gt;flexmojos-maven-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;debug&gt;true&lt;/debug&gt;
          &lt;rslurls&gt;
            &lt;rsl&gt;{artifactId}-{version}.{extension}&lt;/rsl&gt;
          &lt;/rslUrls&gt;
          &lt;targetplayer&gt;${project.flash.version}&lt;/targetPlayer&gt;
        &lt;/configuration&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;goals&gt;
              &lt;goal&gt;optimize&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
&lt;/project&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Now lets create a component that uses the component from the TopLevelLibrary: we will name it: MidLevelComonentThatUsesTopLevelLibrary.mxml and will live in the package com.leonardovarela.blog.examples.midlevellibrary and the contents should be:&lt;br /&gt;
(Please note that the syntax highlighter removes the casing so please make panel-&gt;Panel and toplelvellibraryComponent-&gt;TopLevelLibraryComponent and don't forget the &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; at the beginning of the mxml file):&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Panel title="The best soccer team in the world is from Colombia!" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:top="com.leonardovarela.blog.examples.toplevellibrary.*"&gt;
  &lt;top:TopLevelLibraryComponent/&gt;
&lt;/mx:Panel&gt;

&lt;/pre&gt;We are done with the RSLs, now we want to proceed to create the Flex project that uses them.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;li&gt;Lets create the Flex project&lt;br /&gt;
Lets start with the folder structure.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;PROJECT_HOME/Flex-app/src/main/flex/&lt;/li&gt;
&lt;li&gt;PROJECT_HOME/Flex-app/src/main/test/&lt;/li&gt;
&lt;/ol&gt;Now lets create the pom file:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;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"&gt;
  &lt;modelversion&gt;4.0.0&lt;/modelVersion&gt;

  &lt;parent&gt;
    &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
    &lt;artifactid&gt;multi-level-flex-maven&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;

  &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
  &lt;artifactid&gt;Flex-app&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;packaging&gt;swf&lt;/packaging&gt;

  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;framework&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;caching&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;flex-framework&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
          &lt;artifactid&gt;playerglobal&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.adobe.flex.framework&lt;/groupId&gt;
      &lt;artifactid&gt;playerglobal&lt;/artifactId&gt;
      &lt;version&gt;${project.flex.version}&lt;/version&gt;
      &lt;classifier&gt;${project.flash.player.classifier}&lt;/classifier&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;external&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
      &lt;artifactid&gt;TopLevelLibrary&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;rsl&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;com.leonardovarela.blog.examples&lt;/groupId&gt;
      &lt;artifactid&gt;MidLevelLibrary&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;rsl&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupId&gt;
      &lt;artifactid&gt;flexmojos-unittest-support&lt;/artifactId&gt;
      &lt;version&gt;${project.flexmojos.version}&lt;/version&gt;
      &lt;type&gt;swc&lt;/type&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupid&gt;org.sonatype.flexmojos&lt;/groupId&gt;
        &lt;artifactid&gt;flexmojos-maven-plugin&lt;/artifactId&gt;
        &lt;executions&gt;
          &lt;execution&gt; 
            &lt;goals&gt; 
               &lt;!--goal&gt;optimize&lt;/goal--&gt;
               &lt;goal&gt;wrapper&lt;/goal&gt;
             &lt;/goals&gt; 
             &lt;configuration&gt;
               &lt;debug&gt;true&lt;/debug&gt;
               &lt;rslurls&gt;
                 &lt;rsl&gt;{artifactId}-{version}.swf&lt;/rsl&gt;
               &lt;/rslUrls&gt;
               &lt;targetplayer&gt;${project.flash.version}&lt;/targetPlayer&gt;
             &lt;/configuration&gt;
           &lt;/execution&gt;           
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
&lt;/project&gt;

&lt;/pre&gt;Now that we have the pom, lets create the source code of the application that will use the RSLs:&lt;br /&gt;
In the base package(PROJECT_HOME/Flex-app/src/main/flex folder) create the main application main.mxml with the following contents:&lt;br /&gt;
(Please note that the syntax highlighter removes the casing so please make application-&gt;Application, label-&gt;Label, box-&gt;Box, midlelvellibraryComponent-&gt;MidLevelLibraryComponent and &lt;br /&gt;
midlevelcomponentThatUsesTopLevelLibrary-&gt;MidLevelComponentThatUsesTopLevelLibrary and don't forget the &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; at the beginning of the mxml file):&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mid="com.leonardovarela.blog.examples.midlevellibrary.*"&gt;
  &lt;mx:Box&gt;
   &lt;mx:Label text="Test Label"/&gt;
  &lt;/mx:Box&gt;
  &lt;mid:MidLevelComponentThatUsesTopLevelLibrary/&gt;
&lt;/mx:Application&gt;
&lt;/pre&gt;Now lets create a dumb test case just to illustrate the usage of the test case plugin.&lt;br /&gt;
on the folder PROJECT_HOME/Flex-app/src/main/test/ create a TestApp.as file with the following contents:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="java" name="code"&gt;/**
 *  Copyright 2009 Leonardo Varela
 */
package com.leonardovarela.blog.examples.test{

 import flexunit.framework.TestCase;

 public class TestApp extends TestCase {

  /**
   * Dumb Tests to exemplify unit tests
   */
  public function testDumbTest():void 
  {
        assertEquals("Test is incorrect", "America is the best soccer team ever", "America is the best soccer team ever");
  }
 }
}

&lt;/pre&gt;&lt;br /&gt;
OK!!!! We are good to give it a try!&lt;br /&gt;
&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;Executing the installation:&lt;br /&gt;
Just go to the PROJECT_HOME location and type mvn -DflashPlayer.command=&amp;lt;path to your flash player&amp;gt; install&lt;br /&gt;
where &amp;lt;path to your flash player&amp;gt; could be: C:\flash\FlashPlayer.exe&lt;br /&gt;
&lt;br /&gt;
This -D option is a workaround of a bug that I think is fixed on flex-mojos 3.3 but I haven't given it a test yet.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;Now the part where most of the trouble happens!&lt;br /&gt;
Lets try to execute Flex-app-1.0-SNAPSHOT.html from PROJECT_HOME\multi-level-flex-maven\Flex-app\target&lt;br /&gt;
You will get an RSL Error.... so what you need to do is to copy the swf dependencies(RSLs) to that folder. Go grab them from the target folders of the TopLevelLibrary and MidLevelLibrary Project and place them in the target folder of the Flex-app project.&lt;br /&gt;
There are plenty of better ways to do this, but that was not the scope of this guide.&lt;br /&gt;
If you want to submit an improved pom that copies dependencies automatically! You are very welcome.&lt;br /&gt;
&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;Hopefully you have been working with 3.4.09271 sdk and you will have no problems, if the page tells you that It cannot find the framework...swz then get the SDK from here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3&lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;li&gt;Copy and paste the framework_3.4.0.9271.swz file to the Flex-app target folder. Rename it to framework-3.4.0.9271.swz and execute the Flex-app-SNAPSHOT-1.0.swf file. That file can be found on the %FLEX SDK EXTRACT DIRECTORY%\frameworks\rsls In a web project you would have to have this file in the same location of your swf application, just like we are doing it here. NOTE: Make sure to rename it, We ARE changing the _(underscore) to a -(dash)&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Thanks for making it to the end of the step by step guide. As a Bonus: Here's the code:&lt;a href="http://www.leonardovarela.com/blog/examples/multi-level-flex-maven/multi-level-flex-maven.zip"&gt;CODE!&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;If you really appreciate this post, please post links to it from your community forums etc...&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Please fill the one question  survey on the left side of the post... it will be just 10 seconds..&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;I will create another post with Flex 3.4/RSLS/Cairngorm/BlazeDS/Hibernate soon! Please click on the ads to have time/money to do it!&lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-3564350380141919";
google_ad_host = "pub-1556223355139109";
/* 728x15, created 10/23/09 */
google_ad_slot = "7790679309";
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2082410934238367796-3663560630730884732?l=flexmojos.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bH7NjZG_9lIXK9mz6rIQK97C_jY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bH7NjZG_9lIXK9mz6rIQK97C_jY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bH7NjZG_9lIXK9mz6rIQK97C_jY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bH7NjZG_9lIXK9mz6rIQK97C_jY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Flex-mojos320FlashPlayer10FlexSdk34/~4/8uhW0KAUVD8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/Flex-mojos320FlashPlayer10FlexSdk34/~3/8uhW0KAUVD8/creating-flex-application-with-maven.html</link><author>noreply@blogger.com (Leonardo Varela)</author><thr:total>4</thr:total><feedburner:origLink>http://flexmojos.blogspot.com/2009/10/creating-flex-application-with-maven.html</feedburner:origLink></item></channel></rss>

