Multimodule Flex Maven
Hello.
I have a large (50+ module) flex/java/webapp project that builds with maven. While I can usually get it to eventually work, we waste hours every time the dependencies change, with no real understanding of why it doesn't build in idea but builds fine from the command line.
- Reimporting poms whenever the project structure changes takes 8-10 minutes and often results in build errors or "can't find compile config." (we have configurationReport=true in our poms). We usually have to run the "force reimport" multiple times in a row. Sometimes this is solved by running a command line build outside idea, but often it's necessary to delete all the IML/IPR files and start over.
- Even after reimport, we often see all sorts of good-code-is-red errors. Idea sometimes stops prompting for imports (code is red, no import popup), even though we can ctrl/command click on the actionscript symbol and go to it's source.
- The flex configuration reports generated by idea often do not match (are missing dependencies or point to the wrong dependencies) those generated by the maven command line tool, even when we set our M2_HOME in idea to the same as the command line (this one makes no sense to me). Even if I turn off the config reports in the poms, idea still generates them (incorrectly) !? If we could just disable idea generating these files and generate them manually when the config changes, we would be so much faster!
- Config reports are not generated in dependency order, causing particular problems for link reports and rsls.
- IDEA's war artifacts don't correctly include the swf artifacts (instead include the zipped classes dir, named .swf); manually adding the swf file to the war doesn't cause the war to rebuild when the flex project changes.
- IDEA doesn't install generated artifacts in the local maven repo; so if we execute maven goals in our run configurations, they don't get the latest outputs as made by idea.
- We could build by running maven in idea; but then we loose the speed advantage from idea knowing what's changed; this means a 3.5 minute build every time we change a single file. This doesn't address the good-code-is-red issues (which we can only fix by endless cycles of reimport and command line builds).
We spend literally hours trying to get idea to reconfigure after changing dependencies.
I'm working on putting together a sample project that demonstrates this but it's quite tedious to replicate all these issues; is there any way that we could maybe provide our existing source code under NDA so that you could see what's going on here in a real project? I've attached the poms to
http://youtrack.jetbrains.net/issue/IDEA-66875 .
This is so close to being seemless, it seems like maybe a couple of days of your effort on a real-sized flex/maven/java project would clean up some of these last niggling bugs. We have 20 developers who are seeing these issues.
Thanks for making a really great IDE!
-c
http://youtrack.jetbrains.net/issue/IDEA-66874
http://youtrack.jetbrains.net/issue/IDEA-66875
http://youtrack.jetbrains.net/issue/IDEA-66876
Please sign in to leave a comment.
Hi Christopher,
thank you for your feedback! We'll do our best to resolve your issues. Some first considerations are:
It really does take minutes, every time. Definitely the compiler config is the longest part by far. Is there some way to generate the compiler config without actually running the compile? I see flexmojos maven goals for generate-config-swc and -swf but don't see a way to run it on an aggregator that may include both swfs and swcs. I'm not sure I understand what this process really does. You're relying on flexmojos to parse the configuration from the pom and turn it into a config report you can run the compiler against? Why not just parse the options from the pom directly? Even so, why does parsing the options from the pom have to take so long? What's with all the stuff in target/classes? Is that to speed up compiles by caching font stuff, etc? In other words: why do you need the config reports and why do they take so long to generate?
I think the good-code-is-red is caused by idea not respecting transitive swc dependencies the same way the maven command line tool does. When you compile a swc that depends on another swc, you've implicitly imported those symbols into your swc; but the maven dependencies are still transitive: if my project depends on A.swc and the A.swc pom specifies B.swc as a dependency, maven on the command line still includes B.swc in the compile; the config reports generated by idea do not; so I get errors about missing symbols for anything from B that A didn't use. See IDEA-66875 for an example.
Could you please explain "some technical reasons?" Why does idea not use exactly the same flexmojos code that runs when the config reports are generated from the command line with mvn?
This would be really useful!
The problem is that manually inserting the swf in the war doesn't cause the war to depend on the flex facet; so changes to the project don't cause the war to be rebuilt and changes to the code don't cause the right flex modules to be rebuilt. In the flex run configuration, I arbitrarily select one of the flex swfs (there are many, due to runtime loading) as the "Run configuration for module" but none of the other ones are built. In idea's artifacts there's no dependency between the war and the flex, so only the one swf that I selected as "run configuration for module" is rebuilt; none of the other ones are. I have to manually trigger a "make" of the full project. If I forget to manually "make," then I don't see my changes in the running app.
How else can we help track this stuff down? Would an real sized (20-30 flex modules) example project be helpful? I could also cut down the poms to not include any deps not in a public repo?
Thanks again,
-c
Of course sample project, big or small, would be great (small is better :)). You can contact me directly by email firstName.lastName@jetbrains.com
About speed: If your project contains many snapshots (artifact with snapshot version), don't forget to set "Snapshot update policy" = "Do Not Update" (see Settins -> Maven).
We're still fighting with this. In 106.447, with the fix to http://youtrack.jetbrains.net/issue/IDEA-66875 (thanks!) I can at least reliably reimport the maven project and still have idea build. This is great! However, the reimport is perhaps even slower than previously; about 15 minutes for this build. Profiler snapshot attached to http://youtrack.jetbrains.net/issue/IDEA-67994 .
Any progress on http://youtrack.jetbrains.net/issue/IDEA-56002 ? That would be really helpful. Alternatively, would you consider open sourcing flexmojos idea support so we can help?
Also, we've attempted to upgrade to flexmojos 4 (to fix problems with asdoc) but we can't because the swf compiler configs generated by flexmojos 4 don't include the main mxml file path. See http://youtrack.jetbrains.net/issue/IDEA-67993 .
I'm unfortunately not going to be able to give our source code. I'm working on putting together a non-toy-sized project that you can play with.
Finally, in talking with velo of flexmojos, it seems there's an alternative way to generate the compiler configs that he added for jetbrains specifically in version 4. Are you aware of this?
Thanks,
-c
Will take a look at the snapshot and comment the issue. Does setting "Snapshot update policy" to "Do Not Update" has an effect?
Will fix it for 10.5 release
As for Flexmojos 4 - indeed, it is not fully supported now because IDEA doesn't fully support Maven 3. See Vladimir's comment to the issue.