You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christoph Schönfeld <cs...@sylphen.com> on 2005/11/02 19:42:47 UTC

[M2] How to make maven include generated sources in build

Hi,

I am new to Maven and would like integrate Castor to generate source
code from XML Schema files. 

I found a Castor plug-in for Maven 2.0 at
http://svn.mojo.codehaus.org/trunk/mojo/castor-maven-plugin which I
built and installed the plug-in in my local maven repository. 

I have the attached pom.xml which uses the plug-in. Code generation
works fine. The code is generated in target/generated-sources/castor.

However, I have been unable to find out how to tell Maven to include the
generated source files in the build. When I call 'mvn compile' I get
error messages from the compiler stating that the generated classes were
not found.

I'd be glad about any hints.


Christoph

Re: [M2] How to make maven include generated sources in build

Posted by Christoph Schönfeld <cs...@sylphen.com>.
Nope. :-)
You can use it.




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


Re: [M2] How to make maven include generated sources in build

Posted by Brett Porter <br...@gmail.com>.
Thanks Christoph!

We'd like to start accumulating testimonials on the web site. Would
you mind if we added this?

- Brett

On 11/3/05, Christoph Schönfeld <cs...@sylphen.com> wrote:
> Brett, thank you very much. The patch does what I need.
> Cheers to the person who wrote these improvements!
>
> Keep on going with Maven 2.0 as it really rocks!
> Yesterday, I started experimenting with it and it's such a breeze, I'm
> becoming already productive with Maven, converting our hand-written Ant
> scripts to POM (which means throwing most of the Ant stuff away and
> replacing it with tiny pom.xml files, actually). We have a web
> application consisting of many components which need to be configured
> for different environments and customers. After one day of work
> (including the learning curve) I already have the complete code base
> with >1000 java files in ~20 modules compiling.
>
> An hour ago or so after I finally got the Castor stuff working I began
> to see just how marvellous Maven works with my multi-module project.
> Seems you guys are able to keep the promises you make in the Maven
> introduction. :-)
>
> Once again, thanks for creating this great tool!
>
> Christoph
>
>
> ---------------------------------------------------------------------
> 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: [M2] How to make maven include generated sources in build

Posted by Christoph Schönfeld <cs...@sylphen.com>.
Brett, thank you very much. The patch does what I need. 
Cheers to the person who wrote these improvements!

Keep on going with Maven 2.0 as it really rocks!
Yesterday, I started experimenting with it and it's such a breeze, I'm
becoming already productive with Maven, converting our hand-written Ant
scripts to POM (which means throwing most of the Ant stuff away and
replacing it with tiny pom.xml files, actually). We have a web
application consisting of many components which need to be configured
for different environments and customers. After one day of work
(including the learning curve) I already have the complete code base
with >1000 java files in ~20 modules compiling. 

An hour ago or so after I finally got the Castor stuff working I began
to see just how marvellous Maven works with my multi-module project.
Seems you guys are able to keep the promises you make in the Maven
introduction. :-)

Once again, thanks for creating this great tool!

Christoph


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


Re: [M2] How to make maven include generated sources in build

Posted by Brett Porter <br...@gmail.com>.
I think there is about to be a major revision of the castor plugin -
check the patch in JIRA under the MOJO subproject.

What needs to be done is something like:

project.addCompileSourceRoot( ... )

On 11/3/05, Christoph Schönfeld <cs...@sylphen.com> wrote:
> Hi,
>
> I am new to Maven and would like integrate Castor to generate source
> code from XML Schema files.
>
> I found a Castor plug-in for Maven 2.0 at
> http://svn.mojo.codehaus.org/trunk/mojo/castor-maven-plugin which I
> built and installed the plug-in in my local maven repository.
>
> I have the attached pom.xml which uses the plug-in. Code generation
> works fine. The code is generated in target/generated-sources/castor.
>
> However, I have been unable to find out how to tell Maven to include the
> generated source files in the build. When I call 'mvn compile' I get
> error messages from the compiler stating that the generated classes were
> not found.
>
> I'd be glad about any hints.
>
>
> Christoph
>
>
> ---------------------------------------------------------------------
> 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