Generate Flex project files using Maven
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开发者_StackOverflow社区 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?
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.
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)
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.
Since I didn't accept any of the answers I guess I should post what I went with in the end:
Right click on the project -> Add/Change project type -> Add Flex project type...
精彩评论