Sharing content root

Hi,

i would like to define several modules sharing the same content root.

But this means, that on the Project Panel the shared directories are not
displayed, except for the last one.

Is this a feature or a bug.

If it is a feature, it should be prevented to create modules sharing
content roots.

bye.

7 comments

Yes, this is a feature. The content root should be unique between the
modules that are included in the project.
Sure we well add the warning
See http://www.intellij.net/tracker/idea/viewSCR?publicId=23854
We cannot prevent this for all cases because modules can be imported into
the project.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"flores" <juan.flores@ip-value.de> wrote in message
news:bvq9m3$mk2$1@is.intellij.net...

Hi,

>

i would like to define several modules sharing the same content root.

>

But this means, that on the Project Panel the shared directories are not
displayed, except for the last one.

>

Is this a feature or a bug.

>

If it is a feature, it should be prevented to create modules sharing
content roots.

>

bye.



0

Please do not enforce this restriction. It prevents us from sharing any
file between to web modules. And there are use cases for that. We have a
web module for example which is an application that runs on a weblogic
server.

To test the layout and the correct syntax of JSTL expressions, we take
most of this application plus some mock classes into another module.
This other module runs on a tomcat server and allows you to mock the
data models for the pages, so you can display any single page without
building any context of the application around it.

The only way to achieve this is to have one module include the core web
application plus some files for running it in production mode on
weblogic and the other module ro include the same core stuff plus some
mock classes and files.

Another use case is the following. You have framework java module which
includes a taglib with TLD files. Then you have some web modules which
all use the tag lib. Putting the TLD files in all WEB-INF folders is
possible only by including the same resources (the directory containing
the TLDs) in all web modules.

At the moment this is possible with IDEA 4.0 with the mentioned
"problem" that shared resources appear in one module only. And it works
very well so far. I would really love to see the contents displayed in
both modules instead of introducing a restriction that prevents those
use cases at all.

There has also been some discussion on web modules depending other web
modules meaning that the web content of one module gets included by the
other modules - just like you include classes of one java module in any
other module by setting dependencies. This shows that there certainly is
the need for such setup. Either by including the same content in
multiple web modules or by being able to depend on another web module to
achieve something similar.

Michael

Eugene Zhuravlev wrote:

Yes, this is a feature. The content root should be unique between the
modules that are included in the project.
Sure we well add the warning
See http://www.intellij.net/tracker/idea/viewSCR?publicId=23854
We cannot prevent this for all cases because modules can be imported into
the project.

0

>other module by setting dependencies. This shows that there certainly is
>the need for such setup. Either by including the same content in
>multiple web modules or by being able to depend on another web module to
>achieve something similar.

We are going to add dependencies between Web modules later. In fact, the
preferred way is to group common classes in one module and have other
modules depend on it.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"




0

Yes, I agree that the preferred way should be dependencies. Given that web module B depends web module A, I would expect that

1. compiling B includes the classes of A in the classpath which already works in build 1141

2. you can select to include the classes of A into the web folder of B (e.g. into WEB-INF/classes) like you can do with java modules already.

3. you can (similar to 2.) select for each web root of A if it should be included in B (and maybe even where to put it).

Since (1.) already works, I suspect that (2.) and (3.) are not too hard to implement. Maybe we can see that feature very soon after 4.0 release? What do you think?

Michael

0

I could - as a workaround for the missing web-depends-web support - put all java sources of the two web modules into a sepearte java module and keep the web modules free of those common sources. But am I right that there is no such workaround for shared web resources (JSPs, etc.) possible at the moment?

0

>and keep the web modules free of those common sources. But am I right that
there is no such workaround for shared web resources (JSPs, etc.) >possible
at the moment?

Yes, unfortunately.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Eugene Zhuravlev wrote:

>>and keep the web modules free of those common sources. But am I right that


there is no such workaround for shared web resources (JSPs, etc.) >possible
at the moment?

Yes, unfortunately.


I've filed a bug about, too bad because it's pretty close to working as
far as I can tell.

R

0

Please sign in to leave a comment.