Paul Faulstich wrote:
I've been browsing through the archives looking for some documentation
regarding the thought process that went into the Maven directory
structure conventions, but haven't found much yet.
We are restructuring one of our projects, and it would be helpful to be
able to explain to others (and to understand myself) why Maven's
recommendation differs from Sun's
(http://java.sun.com/blueprints/code/projectconventions.html#92194).
In particular:
- directory names (target vs dist, resources vs conf)
Hey!
Here is my interpretation of this structure (I participated in original
discussion which lead to this "standard"):
target = build in Sun's conventions
maven has no dists folder as projects communicate via the local
repository (or remote repositories) so there is no need to have one
dedicated folder where build artifacts are stored.
resource folder is for resources which will be packed inside jars - not
for application configuration files.
you can still have
src/main/conf
or
src/main/etc
- the purpose of the /main folder under src (src/main/java vs src/java)
the idea behind it was simple - the default configurations of plugins
should work in every case - so you should not be required to change any
configuration file
even if you are doing something less frequent.
Note that:
a) there are almost always two source trees in maven: test and main
(that naturally corresponds to src/main and src/test).
b) in each of those trees there can coexist the code written in
different programming languages - e.g:
src/main/java
src/main/sql
src/main/groovy
src/main/c (for jni)
c) you can have "conf" folder for tests (e.g. src/test/conf).
d) test folder is simply mirroring the structure of main. imo it makes
more sense to have:
src/main/c
src/main/java
src/test/c
src/test/java
then say
src/main-c
src/java
src/test-c
src/test/
- placing tests under src (src/test vs test/testname/src)
maven just supports one test and main source tree - so the convention
test/testname/src is not compatible with this rule.
note that you can still have
src/test/java
src/test/slimdog
src/test/jython
and so on.
say that you are going to write your unit tests only in groovy - so you
will put them to src/test/groovy not to src/test. If the test are
written in Java (which is obviously the most common case) they can still
consequently go to src/test/java so if one day if you will decide that
you want to add a test case written in some scripting language - you can
easly find a place for it.
If this is a dead horse, then please just point me to the discussions
that already exist.
Thanks,
Paul
regards
Michal
-----------------------------------------------------------------------
INTERIA.PL z najlepsza wyszukiwarka... >>> http://link.interia.pl/f18a7
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]