You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aidan Donohoe <ai...@kenamea.com> on 2005/06/17 18:52:16 UTC

How can I have the xdoclet generated files be included in the compile?

Hi,

I am generating java files from xdoclet (into target/xdoclet/ejbdoclet),
and I want these files to be included in the compilation along with the
src directory.

Do I have to copy them into the src dir? (which seems nasty)
Or is there a better/right way to do this?

Thanks for any info,

Aidan.


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


Re: How can I have the xdoclet generated files be included in the compile?

Posted by Pascal Thivent <pa...@gmail.com>.
damn, I should take more time to read the right question. sorry for
the annoyance.

On 6/17/05, Dennis Geurts <de...@gmail.com> wrote:
> Aidan, 
>   
> I guess you want something like this: 
>   
> Suppose the generated source code location is referred to with '${gen.dir}' 
> ( 'target/xdoclet/ejbdoclet' in your case ) 
> then you can make sure they get compiled at the same time as your 
> manually typed java files do, by defining the following preGoal: 
>   
>    <preGoal name="java:compile">
>        <path id="generated.java.compile.src.set" location="${gen.dir}"/>
>        <maven:addPath id="maven.compile.src.set" refid="
> generated.java.compile.src.set"/>       
>    </preGoal>
> 
>  
> please note that it is stated in the documentation that including sources in
> such a way 
> is discouraged. As you mention correctly, it is unwise to copy the generated
> source files 
> into the 'official' source directory (src/main/java). 
>   
> furthermore, as an eclipse fan I must add that by adding the property: 
>   
> 'maven.eclipse.classpath.include=${gen.dir}' 
> to your project and subsequently executing 'maven eclipse' 
> the generated source file are also included in the classpath of your eclipse
> project. 
>   
> a 'clean project' in eclipse could delete the generated sources 
> this can be prevented by adding the property: 'maven.gen.src=${gen.dir}' 
>   
>   
>   
> Dennis 
>   
>  
>   
> On 6/17/05, Pascal Thivent <pa...@gmail.com> wrote: 
> > Hi
> > 
> > i think that the maven.ejb.includes property of the maven ejb plugin
> > is what you're looking for. 
> > 
> > Regards,
> > 
> > On 6/17/05, Aidan Donohoe <ai...@kenamea.com> wrote:
> > > Hi,
> > >
> > > I am generating java files from xdoclet (into target/xdoclet/ejbdoclet),
> > > and I want these files to be included in the compilation along with the
> > > src directory.
> > >
> > > Do I have to copy them into the src dir? (which seems nasty)
> > > Or is there a better/right way to do this? 
> > >
> > > Thanks for any info,
> > >
> > > Aidan.
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> > 
> > 
> > --
> > Pascal
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org 
> > 
> > 
> 
>  


-- 
Pascal

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


Re: How can I have the xdoclet generated files be included in the compile?

Posted by Dennis Geurts <de...@gmail.com>.
Aidan,
 I guess you want something like this:
 Suppose the generated source code location is referred to with '${gen.dir}' 

( 'target/xdoclet/ejbdoclet' in your case )
then you can make sure they get compiled at the same time as your
manually typed java files do, by defining the following preGoal:
  <preGoal name="java:compile">
<path id="generated.java.compile.src.set" location="${gen.dir}"/>
<maven:addPath id="maven.compile.src.set" refid="
generated.java.compile.src.set"/> 
</preGoal>

please note that it is stated in the documentation that including sources in 
such a way
is discouraged. As you mention correctly, it is unwise to copy the generated 
source files
into the 'official' source directory (src/main/java).
 furthermore, as an eclipse fan I must add that by adding the property: 
 'maven.eclipse.classpath.include=${gen.dir}'
to your project and subsequently executing 'maven eclipse'
the generated source file are also included in the classpath of your eclipse 
project.
 a 'clean project' in eclipse could delete the generated sources
this can be prevented by adding the property: 'maven.gen.src=${gen.dir}'
   Dennis
  
 On 6/17/05, Pascal Thivent <pa...@gmail.com> wrote: 
> 
> Hi
> 
> i think that the maven.ejb.includes property of the maven ejb plugin
> is what you're looking for.
> 
> Regards,
> 
> On 6/17/05, Aidan Donohoe <ai...@kenamea.com> wrote:
> > Hi,
> >
> > I am generating java files from xdoclet (into target/xdoclet/ejbdoclet),
> > and I want these files to be included in the compilation along with the
> > src directory.
> >
> > Do I have to copy them into the src dir? (which seems nasty)
> > Or is there a better/right way to do this?
> >
> > Thanks for any info,
> >
> > Aidan.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> 
> --
> Pascal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

Re: How can I have the xdoclet generated files be included in the compile?

Posted by Pascal Thivent <pa...@gmail.com>.
Hi

i think that the maven.ejb.includes property of the maven ejb plugin
is what you're looking for.

Regards,

On 6/17/05, Aidan Donohoe <ai...@kenamea.com> wrote:
> Hi,
> 
> I am generating java files from xdoclet (into target/xdoclet/ejbdoclet),
> and I want these files to be included in the compilation along with the
> src directory.
> 
> Do I have to copy them into the src dir? (which seems nasty)
> Or is there a better/right way to do this?
> 
> Thanks for any info,
> 
> Aidan.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Pascal

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


Re: How can I have the xdoclet generated files be included in the compile?

Posted by Konstantin Priblouda <kp...@yahoo.com>.

--- Aidan Donohoe <ai...@kenamea.com> wrote:

> Hi,
> 
> I am generating java files from xdoclet (into
> target/xdoclet/ejbdoclet),
> and I want these files to be included in the
> compilation along with the
> src directory.
> 
> Do I have to copy them into the src dir? (which
> seems nasty)
> Or is there a better/right way to do this?

look into maven.xml of xdoclet-plugins project
( on sourceforge )  - we do exactly this there.


regards,

----[ Konstantin Pribluda ( ko5tik ) ]----------------
... Auf der Suche nach einen Projekt in Rhein-Main
ab 18.4.2005
----[ http://www.pribluda.de ]------------------------

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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