Project level files in multi-module project...

I have a project that has multiple modules (each with their own CP, output directory etc). My project is arranged like this...

module1/
module2/
module3/
module4/
build.xml
readme.txt

The problem I am having is that once I set up my multi module project I cannot get to the build.xml and readme.txt files (which apply to the entire project as the build.xml is a 'master build script').

Is there any way to add files to the top-level project of a multi module project?

7 comments
Comment actions Permalink

You can add any number of ANT file by using Ant Build toolwindow.

0
Comment actions Permalink

That's true, but you cannot edit them from there and even if you could that only solves the problem for ant files.

I guess, generally speaking, what I am looking for is module nesting. It is not unreasonable that a project may consist of modules which themselves consist of modules. Assuming this is not already implemented (I cant seem to find it) then perhaps it might be a good feature for a later version.

In the mean time, if anyone has a work-around that will allow me to have project level files that display in the file-browser it would be gratefully recieved.

0
Comment actions Permalink

but you cannot edit them from there


You can, just press F4 or use the context menu.

that only solves the problem for ant files.


Unfortunately, that's true. I also missed some trivial module type to just
add "editable" files like XML documentation. Now I use a Java module to do
so, but that's odd.

Tom

0
Comment actions Permalink

but you cannot edit them from there


You can, just press F4 or use the context menu.


Oh, didnt know you could do that! Thanks for the tip :)

that only solves the problem for ant files.


Unfortunately, that's true. I also missed some
trivial module type to just
add "editable" files like XML documentation. Now I
use a Java module to do
so, but that's odd.


This is probably what I will need to do too (and I have done it this way before) but the fact that I need to create a Java module is not a big deal but what is a little more constrictive is that I then have a module that is parrallel to my other modules. I end up with...

module1/
module2/
module3/
module4/
module5/
---build.xml
---build.properties
---readme.txt

...but these files are applicable to the project as a whole. The readme will mention module1, the build.xml (which is the project master build file) will call the module1 build.xml. I will probably end up implementing it exactly like this but it definately jars will me a little as it is totally wrong from a structural point of view.

Thanks for taking the time to reply :)

0
Comment actions Permalink

The problem is also with version control systems, as even though I can
press F4 for our ANT script it is not in any module, which means I can't
check it out from within IDEA.

Amnon

0
Comment actions Permalink

You could also add another module rooted at the project root and then mark the modules directories as excluded.

Ciao,
Gordon

0
Comment actions Permalink

You don't even need to mark the directories, as IDEA will automatically filter out other module's roots from containing modules. That's my usual solution.

--Dave Griffith

0

Please sign in to leave a comment.