You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "david.delbecq" <da...@oma.be> on 2008/03/15 17:21:32 UTC

Multiple source tree in maven 2

Hello,

am trying to mavenize an existing ant based projet. One of the 
caracteristics of the project is it's source tree organization

modules/x/src/...
modules/y/src/...
modules/z/src/...

I thought first of using maven modules for this, but the dependency 
graph makes it impossible (x depends on y which depends on z which 
depends on x, it's just an example). The current ant task just build all 
modules at same time in a single jar. So we'd like to make that too with 
maven2 (the mavenization should not imply a code reorg, whe just want 
that project to provide a pom + jar + dependencies informations). I 
tried to put multiple <sourceDirectory> entries, but maven complains 
there can be only one.

Anyone has a suggestion on how to put multiple tree in compilation? It 
seems possible to put multiple resource trees, but not multiple source 
trees? Maybe using the generate-source goal and some copy goals, someone 
has suggestions?



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


Re: Multiple source tree in maven 2

Posted by Stephen Connolly <st...@gmail.com>.
have a look at the buildhelper-maven-plugin at org.codehaus.mojo

it has the ability to add multiple source paths the "right" way rather  
than your hack

Sent from my iPod

On 15 Mar 2008, at 16:55, "Cyril Ledru" <cy...@gmail.com> wrote:

> Hi,
>
> I had this problem earlier trying to migrate from ant.
> I had sources in src/java and src/util.
>
> What I did is put the  <sourceDirectory> to src and put includes and
> excludes in the maven-compiler-plugin configuration.
> So for you it would be modules in sourceDirectory and then
>
> <includes>
>  <include>x/src/**/*.java</include>
>  <include>y/src/**/*.java</include>
>  <include>z/src/**/*.java</include>
> </includes>
>
> in the <configuration> element of maven-compiler-plugin.
>
> The only problem I have so far is that doing mvn eclipse:eclipse  
> result in
> having only src as source directory so I have to edit my eclipse  
> build path
> by hand.
>
> Having said that I must add that I'm a maven newby and that there's  
> maybe a
> better way to do it.
>
> Cyril.
>
> On Sat, Mar 15, 2008 at 5:21 PM, david.delbecq  
> <da...@oma.be> wrote:
>
>> Hello,
>>
>> am trying to mavenize an existing ant based projet. One of the
>> caracteristics of the project is it's source tree organization
>>
>> modules/x/src/...
>> modules/y/src/...
>> modules/z/src/...
>>
>> I thought first of using maven modules for this, but the dependency
>> graph makes it impossible (x depends on y which depends on z which
>> depends on x, it's just an example). The current ant task just  
>> build all
>> modules at same time in a single jar. So we'd like to make that too  
>> with
>> maven2 (the mavenization should not imply a code reorg, whe just want
>> that project to provide a pom + jar + dependencies informations). I
>> tried to put multiple <sourceDirectory> entries, but maven complains
>> there can be only one.
>>
>> Anyone has a suggestion on how to put multiple tree in compilation?  
>> It
>> seems possible to put multiple resource trees, but not multiple  
>> source
>> trees? Maybe using the generate-source goal and some copy goals,  
>> someone
>> has suggestions?
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Multiple source tree in maven 2

Posted by Cyril Ledru <cy...@gmail.com>.
Hi,

I had this problem earlier trying to migrate from ant.
I had sources in src/java and src/util.

What I did is put the  <sourceDirectory> to src and put includes and
excludes in the maven-compiler-plugin configuration.
So for you it would be modules in sourceDirectory and then

<includes>
  <include>x/src/**/*.java</include>
  <include>y/src/**/*.java</include>
  <include>z/src/**/*.java</include>
</includes>

in the <configuration> element of maven-compiler-plugin.

The only problem I have so far is that doing mvn eclipse:eclipse result in
having only src as source directory so I have to edit my eclipse build path
by hand.

Having said that I must add that I'm a maven newby and that there's maybe a
better way to do it.

Cyril.

On Sat, Mar 15, 2008 at 5:21 PM, david.delbecq <da...@oma.be> wrote:

> Hello,
>
> am trying to mavenize an existing ant based projet. One of the
> caracteristics of the project is it's source tree organization
>
> modules/x/src/...
> modules/y/src/...
> modules/z/src/...
>
> I thought first of using maven modules for this, but the dependency
> graph makes it impossible (x depends on y which depends on z which
> depends on x, it's just an example). The current ant task just build all
> modules at same time in a single jar. So we'd like to make that too with
> maven2 (the mavenization should not imply a code reorg, whe just want
> that project to provide a pom + jar + dependencies informations). I
> tried to put multiple <sourceDirectory> entries, but maven complains
> there can be only one.
>
> Anyone has a suggestion on how to put multiple tree in compilation? It
> seems possible to put multiple resource trees, but not multiple source
> trees? Maybe using the generate-source goal and some copy goals, someone
> has suggestions?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>