You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thomas Tardy <th...@gmail.com> on 2008/02/20 13:44:24 UTC

Using multiple source folders

Hello,

i'm looking for a solution to use multipe source folders in a project. What
I have seen is a solution with multiple modules. Isn't there a possibility
to just define two source folders. We want to separate generated from hand
written source.

Thanks for your help!

Regards,
Thomas

Re: Using multiple source folders

Posted by Thomas Tardy <th...@gmail.com>.
Hi Nick,

thanks for your help. I don't want to generate the source with maven. We are
using the model driven development approach in our project and are now
thinking about splitting the completely generated code from the code with
has to be modified by the developers. Therefore I just want to define a
second source folder, as you can do it in eclipse.

I think i should get it working with the build helper plugin.

Regards,
Thomas


On Feb 20, 2008 1:53 PM, <ni...@planet.nl> wrote:

> Thomas,
>
> Most Maven modules which generate code add the generated code to the build
> path. (Hibernate plugin adds /target/generated-sources/hibernate) If you
> want to add your own folder (say src/generated/java) to the buildpath take a
> look at the buildhelper plugin [1].
>
> If I were you I would look into a plugin which generates your code and add
> it to the build path. Also, when you generate your code in /target it isn't
> added to your SCM so developers are not able to change the generated code
> itself. Which framework are you using to generate your code?
>
> Hth,
>
> Nick Stolwijk
>
> [1] http://mojo.codehaus.org/build-helper-maven-plugin/index.html
>
>
> -----Original Message-----
> From: Thomas Tardy [mailto:thomas.tardy@gmail.com]
> Sent: Wed 2/20/2008 13:44
> To: Maven Users List
> Subject: Using multiple source folders
>
> Hello,
>
> i'm looking for a solution to use multipe source folders in a project.
> What
> I have seen is a solution with multiple modules. Isn't there a possibility
> to just define two source folders. We want to separate generated from hand
> written source.
>
> Thanks for your help!
>
> Regards,
> Thomas
>
>

RE: Using multiple source folders

Posted by ni...@planet.nl.
Thomas,

Most Maven modules which generate code add the generated code to the build path. (Hibernate plugin adds /target/generated-sources/hibernate) If you want to add your own folder (say src/generated/java) to the buildpath take a look at the buildhelper plugin [1].

If I were you I would look into a plugin which generates your code and add it to the build path. Also, when you generate your code in /target it isn't added to your SCM so developers are not able to change the generated code itself. Which framework are you using to generate your code?

Hth,

Nick Stolwijk

[1] http://mojo.codehaus.org/build-helper-maven-plugin/index.html


-----Original Message-----
From: Thomas Tardy [mailto:thomas.tardy@gmail.com]
Sent: Wed 2/20/2008 13:44
To: Maven Users List
Subject: Using multiple source folders
 
Hello,

i'm looking for a solution to use multipe source folders in a project. What
I have seen is a solution with multiple modules. Isn't there a possibility
to just define two source folders. We want to separate generated from hand
written source.

Thanks for your help!

Regards,
Thomas