You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Jeffrey D. Brekke" <jb...@wi.rr.com> on 2003/04/02 06:08:11 UTC

Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

>>>>> On Tue, 01 Apr 2003 13:20:56 -0500, Colin Sampaleanu <co...@exis.com> said:

> Jason van Zyl wrote:
{SNIP]
 
>> Far from arbitrary. People can use the addPath tag to work around
>> it and to migrate projects but I certainly don't recommend it
>> ever. At least in the POM more than one source directory will never
>> be supported.
>> 
> I don't understand how you can say Maven doesn't support multiple
> source directories, what about sourceDirectory,
> unitTestSourceDirectory, integrationUnitTestSourceDirectory,
> aspectSourceDirectory? These are all different source directories
> that are handled by various parts of Maven. To draw the line there
> seems awfully presumptious. With all due respect to your opinion
> (that this handles most cases and results in good practices, which I
> agree), I've been around the block enough to know that I don't know
> everything. If somebody/an organization has a need to add another
> source dir that is on an equal basis to the ones above (to be used
> by a plugin, or whatever), and feel that in their usage this results
> in a cleaner/better setup, power to them. Unfortunately there is no
> way to do it. Is Maven development driven by the needs of the users,
> or the need to enforce your (and in this case mine) idea of best
> practices at the exclusion of others. If it were a matter of
> compromising the best way to do it, or introducing large amounts of
> additional complexity to the setup/build process, I would understand
> it, but that is not the case here. This attittude should apply in
> general, not just to this feature.

Features of Maven are influenced and sometimes defined by users.  I
held fast to the idea that unit tests should not be skipped when
building an artifact, but code was eventually introduced to 'turn off'
that dependency.  This multiple source tree thing is sort of reminding
me of that and I'm +1 to Jason's stand on not introducing changes to
the POM for multiple source trees.

I like Maven to be about best practices and each and every time I've (
or others I've worked with ) ever worked with a project that has
multiple source trees for production code it is a pain and each time
it is easier to treat the trees as seperate projects.

Maven provides a way to build projects, using one source tree for
project code.  I don't think Maven should become a tool to build
anything, anyway.  Maven provides a way for projects to migrate if
they choose Maven: make them into two projects as they want to be.

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by Mark McBride <ma...@llnl.gov>.
I also like the idea listed in the email below.

As to Ben's email here are my answers:

Why do you have multiple source trees?

We are using two tools for our projects. One tool is a code generation tool 
for our o/r mapping layer and we would like to keep it in it's own src 
directory to alleviate problems with the tool killing code we produce with 
the other tool.

What is in them?

We have our object/relational mapping wizard driven code in one src 
directory and we have another src directory that is managed by eclipse 
which we write all of our code that uses the object/relational wizard 
created code.

Do they build distinct artifacts?
They build one distinct war/ear for our projects.


Currently we use a jelly script to move the to src's into a "build/src" 
directory used by Maven as it's individual src directory. So each project 
needs this jelly script and it starts to look more like ant projects. It 
would be nice if Maven did this copy for us.

My other concern was somewhat separate from the pom issue of multiple 
sources. I would like a way to define multiple sources so that plug-ins 
like eclipse:generate-project could take them into account and include the 
appropriate src entries in the eclipse specific classpath file. Maybe I 
should start a separate thread on that subject sense it is somewhat 
different then the multiple src pom issue.

I do think that whatever decision is made about multiple source directories 
there should be some documentation stating how maven uses source 
directories, why it does it that way, etc. I haven't worked on projects 
with multiple source directories before so it would be nice to see 
documentation on the downfalls of multiple source directory projects.

-Mark






At 12:40 PM 4/2/2003 +0200, you wrote:
>michal.maczka wrote:
>
> > won't it be simple just to have:
> >
><sources>
> > <source>
> >    <type>java</type>
> >    <path>src/java</path>
> > </source>
> >
> > <source>
> >    <type>cactus</type>
> >    <path>src/cactus</path>
> > </source>
> >
> > <source>
> >    <type>test</type>
> >    <path>src/test/java</path>
> >    <includes>
> >         <include>**/*Test.java</include>
> >    </includes>
> >    <excludes>
> >         <exclude>**/RepositoryTest.java</exclude>
> >         <exclude>**/JAXPTest.java</exclude>
> >    </excludes>
> > </source>
> >
> > <source>
> >    <type>aspect</type>
> >    <path>src/ascpects</path>
> > </source>
> >
> > <source>
> >    <type>native</type>
>      <path>src/cpp</path>
> > </source>
></sources>
>
> > and then
> >
> > <resources>
> >   <resource>
> >      <type>java<type>
> >       .....
> >   </resource>
> >   <resource>
> >      <type>test<type>
> >       .....
> >   </resource>
> >
> >    ...
> > <resources>
>
>I like your proposal very much. I think it's clear, orthogonal, has
>natural space for extension (with plugins, of course) and translate to
>convenient Jelly (applying JAXP exprs on pom) and Java interfaces.
>
>I give my non-commiter + to the idea.
>
>R.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org

Mark T. McBride
Computer Scientist
Lawrence Livermore National Laboratory
http://www.llnl.gov

Office: (925) 423-1627
Fax: (925) 423-3140

Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by Rafal Krzewski <Ra...@caltha.pl>.
michal.maczka wrote:

> won't it be simple just to have:
> 
<sources>
> <source>
>    <type>java</type>
>    <path>src/java</path>
> </source>
> 
> <source>
>    <type>cactus</type>
>    <path>src/cactus</path>
> </source>
> 
> <source>
>    <type>test</type>
>    <path>src/test/java</path>
>    <includes>
>         <include>**/*Test.java</include>
>    </includes>
>    <excludes>
>         <exclude>**/RepositoryTest.java</exclude>
>         <exclude>**/JAXPTest.java</exclude>
>    </excludes>
> </source>
> 
> <source>
>    <type>aspect</type>
>    <path>src/ascpects</path>
> </source>
> 
> <source>
>    <type>native</type>
     <path>src/cpp</path>
> </source>
</sources>

> and then
> 
> <resources>
>   <resource>
>      <type>java<type>
>       .....
>   </resource>
>   <resource>
>      <type>test<type>
>       .....
>   </resource>
> 
>    ...
> <resources>

I like your proposal very much. I think it's clear, orthogonal, has
natural space for extension (with plugins, of course) and translate to
convenient Jelly (applying JAXP exprs on pom) and Java interfaces.

I give my non-commiter + to the idea.

R.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by "michal.maczka" <mi...@cqs.ch>.
If I can add me 2 cents:

I agree with Jason - the multiple location of the sources are evil...but
I also agree with Colin that if you want or not they are already present in
Maven.

I think that maybe better assumption which is closer to current reality
will be to have just one source location per type (java, test, aspect,
iutest) etc.
but make this process more plugable and easier then it is now, so new types
can be added more easily.


Why do we need things like:

<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>


and then two separate ways of processing resources for "java" sources

and for "test" resources



won't it be simple just to have:

<source>
   <type>java</type>
   <path>src/java</path>
</source>

<source>
   <type>cactus</type>
   <path>src/cactus</path>
</source>

<source>
   <type>test</type>
   <path>src/test/java</path>
   <includes>
        <include>**/*Test.java</include>
   </includes>
   <excludes>
        <exclude>**/RepositoryTest.java</exclude>
        <exclude>**/JAXPTest.java</exclude>
   </excludes>
</source>

<source>
   <type>aspect</type>
   <path>src/ascpects</path>
</source>

<source>
   <type>native</type>
   <path>cpp</path>
</source>


and then

<resources>
  <resource>
     <type>java<type>
      .....
  </resource>
  <resource>
     <type>test<type>
      .....
  </resource>

   ...
<resources>




And still Maven can refuse to work when there are two <source> entries for
the same
type. Even it then display ERROR MESSAGE:

"WE MADE CHOICE FOR YOU - TWO SOURCE LOCATIONS OF THE SAME TYPE ARE STRICTLY
FORBIDEN (tm)"


I see some obvious profits of such representation as I presented above:

For (stupid) example we can have:

<source>
   <type>xml</type>
   <path>src/xml</path>
</source>

and there can be maven plugin which will pretty print and validate XML,
exactly in the same way Jalopy is able to format java sources.

or

<source>
   <type>jelly</type>
   <path>src/jelly</path>
</source>

and there can be check if jelly scripts are gramaticaly correct etc..





I believe that this structure is cleaner and more open then current POM's
XML structure.


Michal



> -----Original Message-----
> From: Ben Walding [mailto:ben@walding.com]
> Sent: Wednesday, April 02, 2003 6:23 AM
> To: Maven Users List
> Subject: Re: Why no multiple locations of sources? ( was Re:
> inter-project dependencies for the Eclipse plugin )
>
>
> Maybe if we understood the "why" of multiple trees, we would be better
> able to describe the "why not" and the "how to work without them"
>
> So to Colin (I think)
>
> Why do you have multiple source trees?
> What is in them?
> Do they build distinct artifacts?
> Would other disparate projects have a requirement to also split code up
> the way you have (which explains unit test / aspect etc)
>
> The fact that your project may be legacy and you just want to shoe-horn
> it into Maven quickly is a legitimate requirement, however there are a
> bazillion ways to skin that cat and maybe you're approaching it from the
> wrong angle?
>
>
> Jeffrey D. Brekke wrote:
>
> >>>>>>On Tue, 01 Apr 2003 13:20:56 -0500, Colin Sampaleanu
> <co...@exis.com> said:
> >>>>>>
> >>>>>>
> >
> >
> >
> >>Jason van Zyl wrote:
> >>
> >>
> >{SNIP]
> >
> >
> >
> >>>Far from arbitrary. People can use the addPath tag to work around
> >>>it and to migrate projects but I certainly don't recommend it
> >>>ever. At least in the POM more than one source directory will never
> >>>be supported.
> >>>
> >>>
> >>>
> >>I don't understand how you can say Maven doesn't support multiple
> >>source directories, what about sourceDirectory,
> >>unitTestSourceDirectory, integrationUnitTestSourceDirectory,
> >>aspectSourceDirectory? These are all different source directories
> >>that are handled by various parts of Maven. To draw the line there
> >>seems awfully presumptious. With all due respect to your opinion
> >>(that this handles most cases and results in good practices, which I
> >>agree), I've been around the block enough to know that I don't know
> >>everything. If somebody/an organization has a need to add another
> >>source dir that is on an equal basis to the ones above (to be used
> >>by a plugin, or whatever), and feel that in their usage this results
> >>in a cleaner/better setup, power to them. Unfortunately there is no
> >>way to do it. Is Maven development driven by the needs of the users,
> >>or the need to enforce your (and in this case mine) idea of best
> >>practices at the exclusion of others. If it were a matter of
> >>compromising the best way to do it, or introducing large amounts of
> >>additional complexity to the setup/build process, I would understand
> >>it, but that is not the case here. This attittude should apply in
> >>general, not just to this feature.
> >>
> >>
> >
> >Features of Maven are influenced and sometimes defined by users.  I
> >held fast to the idea that unit tests should not be skipped when
> >building an artifact, but code was eventually introduced to 'turn off'
> >that dependency.  This multiple source tree thing is sort of reminding
> >me of that and I'm +1 to Jason's stand on not introducing changes to
> >the POM for multiple source trees.
> >
> >I like Maven to be about best practices and each and every time I've (
> >or others I've worked with ) ever worked with a project that has
> >multiple source trees for production code it is a pain and each time
> >it is easier to treat the trees as seperate projects.
> >
> >Maven provides a way to build projects, using one source tree for
> >project code.  I don't think Maven should become a tool to build
> >anything, anyway.  Maven provides a way for projects to migrate if
> >they choose Maven: make them into two projects as they want to be.
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by Jason van Zyl <ja...@zenplex.com>.
On Wed, 2003-04-02 at 03:02, Raphaël Piéroni wrote:
> Hello maven devs and users,
> 
> i dunno why splitting a source tree but as said before maven at the
> moment as multiple trees : one for tests, one for java, one for
> aspects.

The one for aspects will more than likely be removed and be made the
responsibility of the particular plugin. As aspectj is not the only AOP
type mechanism people use. Happens to be the one I use which is why it
got jammed into the POM but it probably doesn't belong in there.

> but i'll see a new one that can be added : aspect-test because some
> aspects are for production execution and some others for tests.
> 
> in such a case : 
> src/aspectj
> src/java
> src/test
> src/aspectjtest
> 
> when using :
> java:compile : use src/java
> aspectj : use src/java+src/aspectj
> test : use src/test after java:compile or aspectj
> test:aspect : use all for compile as we can have aspects that modify he
> "production" code in the aspectjtest directory (eg tracing issues)
> 
> do that make sense ?
> 
> R
> 
> =====
> ------------------------------------
> | Raphaël Piéroni                  |
> | 33+ 223 351 354                  |
> | mailto:rpieroni@dexem.com        |
> | http://www.dexem.com             |
> | mailing:raphael_mailing@yahoo.fr |
> ------------------------------------
> 
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by vm...@pivolis.com.
En réponse à Raphaël Piéroni <ra...@yahoo.fr>:

> Hello maven devs and users,
> 
> i dunno why splitting a source tree but as said before maven at the
> moment as multiple trees : one for tests, one for java, one for
> aspects.
> 
> but i'll see a new one that can be added : aspect-test because some
> aspects are for production execution and some others for tests.
> 
> in such a case : 
> src/aspectj
> src/java
> src/test
> src/aspectjtest
> 
> when using :
> java:compile : use src/java
> aspectj : use src/java+src/aspectj
> test : use src/test after java:compile or aspectj
> test:aspect : use all for compile as we can have aspects that modify he
> "production" code in the aspectjtest directory (eg tracing issues)
> 
> do that make sense ?

Absolutely. Definition of src directories is done qt the plugin level. For 
example, the Cactus plugin defines a src/test-cactus directory. The 
PatternTestig Maven plugin (http://patterntesting.sf.net) defines a src/test-
aspect directory.

-Vincent

> 
> R
> 
> =====
> ------------------------------------
> | Raphaël Piéroni                  |
> | 33+ 223 351 354                  |
> | mailto:rpieroni@dexem.com        |
> | http://www.dexem.com             |
> | mailing:raphael_mailing@yahoo.fr |
> ------------------------------------
> 
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by Raphaël Piéroni <ra...@yahoo.fr>.
Hello maven devs and users,

i dunno why splitting a source tree but as said before maven at the
moment as multiple trees : one for tests, one for java, one for
aspects.

but i'll see a new one that can be added : aspect-test because some
aspects are for production execution and some others for tests.

in such a case : 
src/aspectj
src/java
src/test
src/aspectjtest

when using :
java:compile : use src/java
aspectj : use src/java+src/aspectj
test : use src/test after java:compile or aspectj
test:aspect : use all for compile as we can have aspects that modify he
"production" code in the aspectjtest directory (eg tracing issues)

do that make sense ?

R

=====
------------------------------------
| Raphaël Piéroni                  |
| 33+ 223 351 354                  |
| mailto:rpieroni@dexem.com        |
| http://www.dexem.com             |
| mailing:raphael_mailing@yahoo.fr |
------------------------------------

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Why no multiple locations of sources? ( was Re: inter-project dependencies for the Eclipse plugin )

Posted by Ben Walding <be...@walding.com>.
Maybe if we understood the "why" of multiple trees, we would be better 
able to describe the "why not" and the "how to work without them"

So to Colin (I think)

Why do you have multiple source trees?
What is in them?
Do they build distinct artifacts?
Would other disparate projects have a requirement to also split code up 
the way you have (which explains unit test / aspect etc)

The fact that your project may be legacy and you just want to shoe-horn 
it into Maven quickly is a legitimate requirement, however there are a 
bazillion ways to skin that cat and maybe you're approaching it from the 
wrong angle?


Jeffrey D. Brekke wrote:

>>>>>>On Tue, 01 Apr 2003 13:20:56 -0500, Colin Sampaleanu <co...@exis.com> said:
>>>>>>            
>>>>>>
>
>  
>
>>Jason van Zyl wrote:
>>    
>>
>{SNIP]
> 
>  
>
>>>Far from arbitrary. People can use the addPath tag to work around
>>>it and to migrate projects but I certainly don't recommend it
>>>ever. At least in the POM more than one source directory will never
>>>be supported.
>>>
>>>      
>>>
>>I don't understand how you can say Maven doesn't support multiple
>>source directories, what about sourceDirectory,
>>unitTestSourceDirectory, integrationUnitTestSourceDirectory,
>>aspectSourceDirectory? These are all different source directories
>>that are handled by various parts of Maven. To draw the line there
>>seems awfully presumptious. With all due respect to your opinion
>>(that this handles most cases and results in good practices, which I
>>agree), I've been around the block enough to know that I don't know
>>everything. If somebody/an organization has a need to add another
>>source dir that is on an equal basis to the ones above (to be used
>>by a plugin, or whatever), and feel that in their usage this results
>>in a cleaner/better setup, power to them. Unfortunately there is no
>>way to do it. Is Maven development driven by the needs of the users,
>>or the need to enforce your (and in this case mine) idea of best
>>practices at the exclusion of others. If it were a matter of
>>compromising the best way to do it, or introducing large amounts of
>>additional complexity to the setup/build process, I would understand
>>it, but that is not the case here. This attittude should apply in
>>general, not just to this feature.
>>    
>>
>
>Features of Maven are influenced and sometimes defined by users.  I
>held fast to the idea that unit tests should not be skipped when
>building an artifact, but code was eventually introduced to 'turn off'
>that dependency.  This multiple source tree thing is sort of reminding
>me of that and I'm +1 to Jason's stand on not introducing changes to
>the POM for multiple source trees.
>
>I like Maven to be about best practices and each and every time I've (
>or others I've worked with ) ever worked with a project that has
>multiple source trees for production code it is a pain and each time
>it is easier to treat the trees as seperate projects.
>
>Maven provides a way to build projects, using one source tree for
>project code.  I don't think Maven should become a tool to build
>anything, anyway.  Maven provides a way for projects to migrate if
>they choose Maven: make them into two projects as they want to be.
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org