Maven can be installed with a few clicks, straight from the Eclipse MarketPlace:

  1. Go to Help>Eclipse MarketPlace
    Screen shot 2011 05 16 at 18.02.03 How to install maven in Flash Builder 4.5
  2. Type ‘Maven’ into the filter
    Select m2Eclipse, click on install:
    Screen shot 2011 05 19 at 11.36.20 How to install maven in Flash Builder 4.5
  3. Click Next, Accept T&C, click Finish, restart FB.
    Screen shot 2011 05 19 at 11.36.52 How to install maven in Flash Builder 4.5

How to enable m2eclipse on your project:

  • right click on your project in Package explorer,
    click maven>Enable Dependency Management
    (you can only do this on maven projects – ie. you have to have a pom.xml in your project root)
    Screen shot 2011 05 19 at 13.09.02 How to install maven in Flash Builder 4.5

This will allow you to:

  1. trigger maven commands straight from Flash Builder:
    go to Run As, or Debug As:
    Screen shot 2011 05 19 at 11.43.08 How to install maven in Flash Builder 4.5
    - or -
  2. Manage(update/add/remove) Dependencies:
    Screen shot 2011 05 19 at 13.12.12 How to install maven in Flash Builder 4.5
    - or -
  3. View the Dependency Graph of your Flex or AS3 modules:
    open the pom xml of a child module, select Dependency Graph:
    Screen shot 2011 05 19 at 13.36.56 1024x160 How to install maven in Flash Builder 4.5
Tagged with:
 

6 Responses to How to install maven in Flash Builder 4.5

  1. kumar says:

    cool tip thanks

  2. Samer Kanjo says:

    I can get everything working using Maven command line just fine but m2eclipse in Flash Builder is another story. I was wondering, have you gotten a dependency on a single flex library project to work with another flex library project? Or even a flex library project to a flex project?

    • zoltanb says:

      Hi Samer,

      Flash Builder 4.5 will ignore the dependencies in your pom file, so you will need to copy all swc dependencies into a folder and set it as a swc folder.
      A simple way to automate it:

      1. create a folder in your project root, eg. libs-generated

      2. go to properties>Flex Build Path>Add SWC Folder. Select the folder you created in your pom.xml

      3. Edit your pom.xml and create a hook to process-sources maven lifecycle phase where you copy all dependencies into libs-generated
      You can use the copy-dependencies goal for this.

      I hope it helped,

      Zoltan

      • Samer Kanjo says:

        I tried the dependency plugin but it was a huge wart and ultimately not worth it when managing multiple modules. I decided to give Intellij IDEA a try, which was hard considering I have been using Eclipse since it replaced VisualAge for Java. I have to tell you, it is great so far. Full Maven support for Java and Flex.

        When exploring for a solution to this problem, I read a reply from Marvin Froeder in which he indicated Sonatype is working on integrating Flexmojos with m2eclipse. I would assume Adobe has an interest as well. But by the time that happens it may very well be too late for me because I may not want to come back to Eclipse.

        Thanks for the comment. It helped confirm what seemed to be the case.

        • zoltanb says:

          Hi Samer,

          You are absolutely right, currently it’s a real pain to use Maven with Flash builder or FDT.

          Adobe are looking into adding maven/flexmojos support into FB, hopefully it will be available to the public soon.

          For the time being IntelliJ works really well with Maven Flex projects, it gives you syntax highlighting and code completion straight from pom dependencies, there’s no need to copy the swc-s back into a lib folder.

  3. URL says:

    … [Trackback]…

    [...] Read More here: zoltanb.co.uk/how-to-install-maven-in-flash-builder-4-5/ [...]…

Leave a Reply

Your email address will not be published. Required fields are marked *

*


9 − four =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">