views:

81

answers:

3

I've got a Java/Flex project that I'm building using Maven. After doing some research I'm using the Flexmojos project (http://flexmojos.sonatype.org/) for the Flex part, and almost everything seems to work fine so far (after a bit of struggling). I'm using version 4.0-alpha-5 (4.0-SNAPSHOT didn't seem to work for me).

The Flex projects isn't recognized by Eclipse as Flex projects though. If I manually change the .project file and add .actionScriptProperties and .flexProperties files, Eclipse seems to recognize the projects as Flex projects.

I'm pretty new to everything Maven-connected, so I'm not sure about everything is connected. Where is the project files configurated to be set up? How can I automatically create the project files?

A: 

I also had issues trying to work with Flex/Maven/Flexmojos (and also my colleagues). After a long struggle I was still not able to import the Flex/Maven projects into Eclipse, so I was working with regular Flex projects and with Java/Maven projects in the same time.

After a while I discovered that IntelliJ is able to properly import Flex/Maven projects, so it can be another option.

Cornel Creanga
A: 

The reason the project is not recognized is perhaps because the m2eclipse plugin doesn't understand that. Changing project and classpath, and even committing them to svn (provided they have no absolute paths) is perfectly OK (especially that you can't choose another IDE).

(This tutorial is quite useful, I guess you've seen it)

Bozho
committing them to svn? urgh. whenever anybody changes any eclipse preference you get a version conflict? bad idea.
seanizer
@seanizer not every preference is reflected in these files. Most prefernces go to .metadata. In these two files go only the classpath (which remains unchanged if using maven) and natures of the project. Ours were in SVN, with the same scenario as above, without any problem, so it's not a bad idea.
Bozho
A: 

There is a FlexBuilder plug-in for Eclipse that makes managing Flex projects in Eclipse much easier, but unfortunately it's non-free:

https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder

If you're not willing to go that route, I've actually had better luck integrating Flex and Maven into NetBeans than doing the same in Eclipse. I could never quite get m2eclipse set up properly, but newer versions of NetBeans support Maven natively.

Also, for building Flex from Maven, I ended up having Maven run an ant task that ran mxmlc. It works really well, so if you're having trouble with Flexmojos that's another option you may consider.

Dan M