IDEA plugin with war/web module

It appears that setting up a war configuration in gradle + running “gradle idea” does not generate a web module. Has anyone figured out how to get gradle to generate a web module correctly for IDEA? I seem to be back in to the manual configuration world…

You can hook up to the generation of the *iml and *ipr, see the docs: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html and http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaProject.html (especially the withXml {} method).

It’s not beautiful but you could configure the web-module stuff there provided you know how it looks like in the idea metadata.

Hope that helps!

There is an interesting post about it but it’s far from perfect (won’t work with multi-module WARs):

http://java.dzone.com/articles/hell-intellij-and-gradle