6 Replies Latest reply on Dec 6, 2010 9:06 AM by Tony.Smith.verical

    Flash Builder 4 + Maven


      I'm using flexmojos to successfully build my flex project from the command line and am now struggling greatly to use Flash Builder 4 on the same project.  I know I have Flash Builder installed correctly because if I create a new Flash Builder 4 project everything (e.g. code hinting, etc.) works.


      But in my maven Flash Builder 4 project I am using a different directory structure for the sources and unit tests and although I have used the flexmojo:flexbuilder goal to create my flash builder project files, the project in Eclipse to totally broken...I get syntax highlighting, but no code hinting for example.


      Has anyone gotten this work work?  If so, what are your project flash builder settings?

        • 1. Re: Flash Builder 4 + Maven

          I'm having the EXACT same problem reported by you as well as here:




          Steps to reproduce:


          1) Install Adobe Flash Builder 4 Standalone (I initially tried with Spring Toolsuite 2.5.0, but thought I should try with the standalone version from Adobe).

          2) Open FB4 and create a brand new workspace

          2) Add Eclipse Galileo and M2Eclipse as update sites

          3) Install m2eclipse

          4) From the command line, create a basic maven project via 'mvn archetype:create'.

          5) Remove the src folder and change packaging type to pom

          6) In FB4, import the new maven project

          7) Create a new Flex Project via File -> New -> Flex Project. Change the location so that it's in a folder under your newly created maven project

          8) Open Main.mxml -- notice that the generated file has syntax errors in it (another issue). Fix those errors and attempt the Content Assist -- no dice


          Notice that this is a vanilla FB4 standalone install. The only thing I added was the M2Eclipse plugin. Also, I am NOT using flexmojos, nor have I added a <modules/> section to the parent pom yet. As far as FB is concerned, the new flex project is just in a folder underneath another in it's workspace. Also note that this is a brand new workspace -- so a corrupted workspace shouldn't be an issue (as was apparent in the beta).


          This has been driving me nuts. We need this functionality. We have a multimodule maven project and really want to use Flex and Flash Builder. We're still in the eval period for FB, but may have to forgo buying FB and instead go with FlashDevelop, even though it's not as powerful.



          • 2. Re: Flash Builder 4 + Maven

            ok -- where to begin!


            1) You really need to read everything you can on the flexmojos Google discussion group here:




            2) Realize that Flash Builder has no relationship whatsoever with Maven, even if M2Eclipse is installed.  Eclipse, and M2Eclipse has no relationship with Flexmjos.  You are going to have two completely different work setups:  1) FlashBuilder for use from within Eclipse and 2) Maven for use from the command line or a continuous build server.  Neither one has ANY relationship with the other at all.


            3) Flex projects in Eclipse should not have the Maven facet and should not be imported as Maven projects.  This will confuse the heck out of Eclipse.  They should be created by FlashBuilder and then manually modified by yourself to be more "maven-like". Then manually modify the FlashBuilder project to use the new Maven style directories.


            4) Maven will download the FlexSDK artifacts automatically, however FlashBuild must have the Adobe SDK installed locally.  Make sure these have the same exact version.



            It took some fiddling, but now my FlashBuilder projects work great in Eclipse and they work great from Maven on the command line so i feel like I have the best of both worlds.

            • 3. Re: Flash Builder 4 + Maven
              justinmiller621 Level 1

              Thanks for the response. This is pretty much the workflow I've come up with, but I think it's a horrible one at that.


              I think that if Adobe is going to supply Flash Builder as an Eclipse plugin, it has to play nice with other plugins you may have installed. I'm not saying there aren't going to be issues because Adobe can't test with every possible combination of plugins. But this is a pretty big one IMO. I'm tempted to point my finger more at Adobe rather than the M2Eclipse devs since I see a problem in FB, not in my other usage of m2eclipse.


              I would amend your second suggestion by saying that I create a completely separate workspace for my flex projects. NOT using the m2eclipse plugin for my other java modules is unacceptable.



              • 4. Re: Flash Builder 4 + Maven
                hdave123 Level 1

                Your right on.  Of course I use M2Eclipse for my Java work...its indespensible.


                Having used Flash Builder for a while now, I really feel I can say it is a piece of crap.  I've taken a hard look at IntelliJ IDEAS and its very good, but I just can't leave eclipse.  I've also been following FDT4 and it looks much better than Flash Builder...may be purchasing that one soon...

                • 5. Re: Flash Builder 4 + Maven
                  justinmiller621 Level 1

                  Yeah, I don't know much about IntelliJ. I would just hate having to use two different IDEs. That's what's nice at least about FB.


                  When FB works, its fine. All I really use it for is the XML view and content assist. I rarely use the design view. I also love the debugger.


                  I've played a little with FDT. They have more pricepoints than FB, but you have to pay a lot more to get the debugger.

                  • 6. Re: Flash Builder 4 + Maven

                    I am also running into this problem but I found something even more strange. I have a parent folder call "client" that is holds the master POM and the subdriectories are module projects. All module projects are name "client-XXXX". If I create a new Flex project called "zzzzzzzz", the resulting project is corrupt and code completion is broken. Application that is created:


                    <?xml version="1.0" encoding="utf-8"?>
                    <application xmlns:fx="http://ns.adobe.com/mxml/2009"
                            <!-- Place non-visual elements (e.g., services, value objects) here -->



                    Upon trying to fix this I accidently created a Flex project that works just by naming it "aaaaaaa". The application that was created:


                    <?xml version="1.0" encoding="utf-8"?>
                    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
                            <!-- Place non-visual elements (e.g., services, value objects) here -->


                    Why? I have no idea but I imagine there is a bug in the IDE (or the Maven plugin) that is relying on the directory order before building a new Flex project.