You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Eric Pugh <ep...@upstate.com> on 2004/07/10 14:33:30 UTC

maven.gen.src added to maven?

Hi all,

Can we add maven.gen.src=${maven.build.dest}/generated-sources?

I've been doing a bunch of work with the Hibernate, Xdoclet, and Eclipse
plugins for a client.  One of the challenges we had was getting source code
generated via the Xdoclet and Hibernate plugins to play nice w/ a normal
Maven build as well as using it within Eclipse.  Eclipse is their primary
environment for their developers, so Maven had to play nice with Eclipse.

The biggest challenge was getting various generated code bits into the
/target directory.  When we put files in /target/classes and then ran builds
in Eclipse the /target/classes directory would be completely cleaned, and
wiped out the generated code that was needed.

After chatting with JvZ, I added to the Eclipse plugin the ability to add as
seperate source directories anything in ${maven.gen.src}.  So, after
generating hibernate mapping files and a ddl I would have:
/target/generated-sources/xdoclet
/target/generated-sources/schema

and they would each be a source folder in Eclipse.  Works great.  However,
because maven.gen.src is defined in the Eclipse plugin only, you have to
specify for the hibernate and xdoclet plugins the full path to generate
source into.  It would be much simpler if maven.gen.src worked the same way
that maven.build.dest and other properties like that work.

Eric


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


Re: maven.gen.src added to maven?

Posted by Trygve Laugstøl <tr...@ifi.uio.no>.
On Sat, Jul 10, 2004 at 01:33:30PM +0100, Eric Pugh wrote:
> Hi all,
> 
> Can we add maven.gen.src=${maven.build.dest}/generated-sources?

Where would you like to add this? 
Which plugins would be affected/need up be updated.

> 
> I've been doing a bunch of work with the Hibernate, Xdoclet, and Eclipse
> plugins for a client.  One of the challenges we had was getting source code
> generated via the Xdoclet and Hibernate plugins to play nice w/ a normal
> Maven build as well as using it within Eclipse.  Eclipse is their primary
> environment for their developers, so Maven had to play nice with Eclipse.
> 
> The biggest challenge was getting various generated code bits into the
> /target directory.  When we put files in /target/classes and then ran builds
> in Eclipse the /target/classes directory would be completely cleaned, and
> wiped out the generated code that was needed.
> 
> After chatting with JvZ, I added to the Eclipse plugin the ability to add as
> seperate source directories anything in ${maven.gen.src}.  So, after
> generating hibernate mapping files and a ddl I would have:
> /target/generated-sources/xdoclet
> /target/generated-sources/schema
> 
> and they would each be a source folder in Eclipse.  Works great.  However,
> because maven.gen.src is defined in the Eclipse plugin only, you have to
> specify for the hibernate and xdoclet plugins the full path to generate
> source into.  It would be much simpler if maven.gen.src worked the same way
> that maven.build.dest and other properties like that work.
> 
> Eric
> 

As dIon said I don't think we should make changes like this before 1.0 but
I'm +1 for this after a Maven 1.0 release.

--
Trygve

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


Re: maven.gen.src added to maven?

Posted by Jason van Zyl <jv...@maven.org>.
On Sat, 2004-07-10 at 08:47, Dion Gillard wrote:
> Do we want to do this so close to 1.0?

I don't think it would be wise to make this addition this close to 1.0,
but it can definitely be added post 1.0.

How it will be added by making an addition to this:

http://cvs.apache.org/viewcvs.cgi/maven-components/maven-model/maven.mdo?rev=1.48&view=auto

The goal of using the model will include zero impact on current usage of
the model in 1.x and all releases post 1.0 will use the model so if you
want to make an addition lets pick the element to add now in
preparation.

Brett is coming to Guelph in about 10 days and while he's here one of
things we're going to do is formulate a plan of attack for moving the
1.x code over to using the model in a first phase and then the project
builder from the component-based code.

I'm basically lying in wait for 1.0 release at this point. The code for
1.0 is not going change unless there is a serious show stopper and
subsequent to the 1.0 release I am going to start merging the
component-based code with 1.x as fast as humanly possible. The goal is
zero impact on usage which will restrict the use of some of the more
advanced features found in the components but compatibility is more
important.

So as far as the generation concerns go, I am totally willing to help
you make changes to the model and flesh out any ideas required to make
code generation scalable. So you certainly need to be able to compile
generated sources, but you may also want to generate resources from
generated sources or process the generated sources in any arbitrary
fashion and we want to do this in a way that avoids coupling between
plugins because that's just a disaster waiting to happen.

So it's easy enough to have something like maven.compile.src.set
(compileSourceRoots in m2) and allow plugins to make additions to this
set for compilation but we have to take this another step and make any
additions that allow any arbitrary processing on the generated sources.
So you might generate some sources with xdoclet tags in them that you
want to generate mappings from. Maybe that's a contrived example but
that's the type of thing we should account for.

I assume you need this asap for your client so we can start doing this
work on HEAD if you're in a serious rush. I'll give you any help you
need. I was going to wait until Brett got here but we can experiment
getting the model working in HEAD as that won't affect anything insofar
as 1.0 is concerned. 

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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


Re: maven.gen.src added to maven?

Posted by Dion Gillard <di...@gmail.com>.
Do we want to do this so close to 1.0?

On Sat, 10 Jul 2004 13:33:30 +0100, Eric Pugh <ep...@upstate.com> wrote:
> Hi all,
> 
> Can we add maven.gen.src=${maven.build.dest}/generated-sources?
> 
> I've been doing a bunch of work with the Hibernate, Xdoclet, and Eclipse
> plugins for a client.  One of the challenges we had was getting source code
> generated via the Xdoclet and Hibernate plugins to play nice w/ a normal
> Maven build as well as using it within Eclipse.  Eclipse is their primary
> environment for their developers, so Maven had to play nice with Eclipse.
> 
> The biggest challenge was getting various generated code bits into the
> /target directory.  When we put files in /target/classes and then ran builds
> in Eclipse the /target/classes directory would be completely cleaned, and
> wiped out the generated code that was needed.
> 
> After chatting with JvZ, I added to the Eclipse plugin the ability to add as
> seperate source directories anything in ${maven.gen.src}.  So, after
> generating hibernate mapping files and a ddl I would have:
> /target/generated-sources/xdoclet
> /target/generated-sources/schema
> 
> and they would each be a source folder in Eclipse.  Works great.  However,
> because maven.gen.src is defined in the Eclipse plugin only, you have to
> specify for the hibernate and xdoclet plugins the full path to generate
> source into.  It would be much simpler if maven.gen.src worked the same way
> that maven.build.dest and other properties like that work.
> 
> Eric
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 


-- 
http://www.multitask.com.au/people/dion/

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


RE: maven.gen.src added to maven?

Posted by Eric Pugh <ep...@upstate.com>.
Yes, this is somewhat similiar.  Instead of changing how Maven works, by
allowing multiple sources, I was hoping to just get another "well known
property" setup that multiple plugins could use.  However, now that 1.0 is
out, and 1.1 is in the future, maybe this is the way to go..

maven.gen.src could be added for 1.1, and then, if multiple sources was
added, could be deprecated in favor of multiple sources.

Eric

> -----Original Message-----
> From: Pål Brattberg [mailto:pal@eminds.se]
> Sent: Monday, July 12, 2004 11:49 PM
> To: Maven Developers List
> Subject: Re: maven.gen.src added to maven?
>
>
> Eric Pugh wrote:
> > Can we add maven.gen.src=${maven.build.dest}/generated-sources?
>
> This sounds alot like what http://jira.codehaus.org/browse/MAVEN-723
> talks about (albeit in a different context).
>
> If what you are talking about can/should be done, wouldn't this be just
> another way of using multiple source directories?
>
> What I'm getting at is this; if we can do this, can't we also support
> multiple source directories as well? Would make the solution more
> complete IMHO.
>
> / pål
>
> --
> Pål Brattberg
>
> Eminds AB
> S:t Eriksgatan 37a
> 112 34 Stockholm
>
> http://www.eminds.se
>
> Direct: +46 8 545 639 80
> Mobile: +46 7 077 000 81
> Fax:    +46 8 545 639 81
> E-mail: pal@eminds.se
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


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


Re: maven.gen.src added to maven?

Posted by Pål Brattberg <pa...@eminds.se>.
Eric Pugh wrote:
> Can we add maven.gen.src=${maven.build.dest}/generated-sources?

This sounds alot like what http://jira.codehaus.org/browse/MAVEN-723 
talks about (albeit in a different context).

If what you are talking about can/should be done, wouldn't this be just 
another way of using multiple source directories?

What I'm getting at is this; if we can do this, can't we also support 
multiple source directories as well? Would make the solution more 
complete IMHO.

/ pål

--
Pål Brattberg

Eminds AB
S:t Eriksgatan 37a
112 34 Stockholm

http://www.eminds.se

Direct: +46 8 545 639 80
Mobile: +46 7 077 000 81
Fax:    +46 8 545 639 81
E-mail: pal@eminds.se


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


Re: maven.gen.src added to maven?

Posted by David Jencks <da...@coredevelopers.net>.
On Saturday, July 10, 2004, at 05:33 AM, Eric Pugh wrote:

> Hi all,
>
> Can we add maven.gen.src=${maven.build.dest}/generated-sources?
>
> I've been doing a bunch of work with the Hibernate, Xdoclet, and 
> Eclipse
> plugins for a client.  One of the challenges we had was getting source 
> code
> generated via the Xdoclet and Hibernate plugins to play nice w/ a 
> normal
> Maven build as well as using it within Eclipse.  Eclipse is their 
> primary
> environment for their developers, so Maven had to play nice with 
> Eclipse.
>
> The biggest challenge was getting various generated code bits into the
> /target directory.  When we put files in /target/classes and then ran 
> builds
> in Eclipse the /target/classes directory would be completely cleaned, 
> and
> wiped out the generated code that was needed.
>
> After chatting with JvZ, I added to the Eclipse plugin the ability to 
> add as
> seperate source directories anything in ${maven.gen.src}.  So, after
> generating hibernate mapping files and a ddl I would have:
> /target/generated-sources/xdoclet
> /target/generated-sources/schema

Shouldn't this be
/target/generated-sources/hibernate?  I don't know if hibernate is 
generating something or only xdoclet, nor the content of schema.

I think total confusion will result unless the directory is clearly 
labeled with the name of the tool that generated the source.

Since tools such as xdoclet may generate several kinds of source 
artifacts, perhaps having another level of directories would be wise:

/target/generated-sources/xdoclet/java
/target/generated-sources/xdoclet/ejb

thanks
david jencks


>
> and they would each be a source folder in Eclipse.  Works great.  
> However,
> because maven.gen.src is defined in the Eclipse plugin only, you have 
> to
> specify for the hibernate and xdoclet plugins the full path to generate
> source into.  It would be much simpler if maven.gen.src worked the 
> same way
> that maven.build.dest and other properties like that work.
>
> Eric
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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