Why does exist this validation: "Web resource directory should be locate under module root."

Hi, I'm wondering why if I have a project structure like this one:

- parent-module
---- out/classes
---- child-module

And then I configure a Web Facet in the "child-module" I'm unable to add "parent-module/out/classes" as a "Web Resource Directory" for the child module because it is being validated that the added resource directories are below the module related to the facet. Well... it seems obvious but there are some cases where it is undesirable. For example if parent-module is where my applet code resides and child-module is a web app created only for testing the applet. In that situation I do really need to configure parent-module/out/classes as a web resource directory in child-module to get inmediate class reloading (used with codebase_lookup and codebase applet parameters). Well it could seem a not too common use case but anyway why does that validation exists?

Waiting for your answers as I had to edit child-module.iml manually to configure by web resource directory.


1 comment
Comment actions Permalink

IDEA need to be sure that files under a web resource directory belong to the correct module otherwise reference resolving or code completion in web
files may start to work incorrectly.

Why do you need to add a directory containing generated classes as a web resource directory? If you deploy the webapp using an artifact you can add
the classes directory directly into the 'Output Layout' of the artfict instead of adding a web resource directory. Also the artifact editor has a
special 'module compile output' item to put a java module output to the artifact.

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"


Please sign in to leave a comment.