Note: before starting please make sure that Maven Integration Extension plugin is enabled at Settings (Ctrl+Alt+S), Plugins page.
If you are using Flexmojos version 3.4 or higher, then the only thing you need to do to import your Flexmojos project to IntelliJ IDEA is to click New Project on the File menu and select your pom.xml file.
That’s all! Right after that you have full coding assistance, ability to compile your project in the same way as Maven does, and to run and debug your application in IntelliJ IDEA.
Note: get more information about configuring Flex SDK sources and documentation for Flexmojos projects.
How does this work? When importing Flexmojos project, IntelliJ IDEA:
- Creates special type of SDK — Flexmojos SDK with name compiler-XXX.pom that contains information required to launch Flex compiler and debugger. In SDK configuration dialog you may increase Flex compiler heap (if your project is huge) and configure AIR paths (if you want to run/debug AIR applications):
- Creates modules with Flex facets.
- Generates compiler configuration file for each facet (target/XXX-config-report.xml). This feature is new in Flexmojos 3.4; instructions for previous Flexmojos versions project are below. IntelliJ IDEA uses these files as custom compiler configuration for Flex compilation:
If something goes wrong and you have red code in editor or you have problems with compiling project or launching tests in IDEA then you should make sure that Flex compiler configuration files (target/XXX-config-report.xml) and some other auxiliary files (target/classes/config-XXX) are up-to-date. To do that please run following from command line for your root project:
mvn compile -DconfigurationReport=true
Note that it is important to use compile because in this case dependencies between projects will be resolved as files from target folders whereas install will generate references to local maven repository that is incorrect for development purpose.
-DconfigurationReport=true flag means the same as <configurationReport>true<configurationReport> option in pom.xml but using command line flag is better because you need to skip configuration report generation when executing install goal.