Is there a way in maven to specify which files in src/main/java belong
to a particular module? I do not feel much for setting up different
src/main/java (etc) folders for each module...

There should be one pom.xml per artifact (module).  The documentation says one could configure in a pom file where sources/resources/tests/etc are, instead of using standard layout.  We have to try, I don't have experience with such configuration.

The code I just mentioned handles all this.  For an example of a generated pom see:


Unilever Centre for Molecular Science Informatics
Cambridge University Chemical Laboratories             Tel: 01223 763073
Lensfield Road                                    email:
Cambridge CB2 1EW