You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeroen Breedveld <je...@x-hive.com> on 2004/12/27 13:40:16 UTC

generate src with XSLT

Hi all,

I'm evaluating Maven for an existing Ant built project in our company.
I'm doing so, basically, by just starting to use it.

Our project uses sources generated with XSLT that have to be generated
before all the other sources are compiled because they are dependent on
it. Is there a default goal that can do this for me or do I have to use
a <preGoal name="java:compile"> in maven.xml to generate the sources
myself?

Thanks and regards,

Jeroen

--

X-Hive Corporation
e-mail: jeroenb@x-hive.com
phone: +31 10 2818080
http://www.x-hive.com 

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


Re: generate src with XSLT

Posted by Dion Gillard <di...@gmail.com>.
You can't have two <sourceDirectory/> elements in project.xml.


On Tue, 28 Dec 2004 11:19:26 +0100, Jeroen Breedveld <je...@x-hive.com> wrote:
> 
> || -----Original Message-----
> || From: Jefferson K. French [mailto:jeff@frenches.org]
> || Sent: maandag 27 december 2004 14:56
> || To: Jeroen Breedveld
> || Cc: users@maven.apache.org
> || Subject: Re: generate src with XSLT
> ||
> ||
> || You could generate the sources in a java:compile preGoal as
> || you mention, or you could generate them in a subproject that
> || the rest of your project depends upon. I've done it both
> || ways, but prefer the subproject route because it seems
> || cleaner / more modular to me.
> 
> The generated sources and other sources are dependant on each other, right
> now I can't even get them to compile using two <sourceDirectory/> elements.
> Would it be possible to see them as separate projects?
> 
> Thanks and regards,
> 
> Jeroen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


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

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


RE: generate src with XSLT

Posted by Jeroen Breedveld <je...@x-hive.com>.
|| -----Original Message-----
|| From: Kris [mailto:kris@heaffudene.com] 
|| Sent: woensdag 29 december 2004 00:07
|| To: users@maven.apache.org
|| Subject: Re: generate src with XSLT
|| 
|| In order to get java:compile to compile your two sets of 
|| source at the same time, you need to understand the 
|| java:compile goal.  The java:compile goal uses an ant 
|| pathset variable called "maven.compile.src.set" and compiles 
|| java files on that path set.  This can be done with the 
|| following two lines which must be executed before java:compile.
|| 
||       <ant:path id="maven.mygenname.compile.src.set"
||             location="${maven.build.dir}/generated-srcs/mygenname"/>
|| 
||       <maven:addPath id="maven.compile.src.set"
||                      refid="maven.mygenname.compile.src.set"/>
|| 
|| Hope that helps,

Thanks, this sure does! 

Regards,

Jeroen



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


Re: generate src with XSLT

Posted by Kris <kr...@heaffudene.com>.
Hi,

Standard advice for doing things like this is to find a plugin that does
something similar and understand that then apply as required.  For what you
are doing, look at antlr, castor, javacc plugins.  I recommend concentrating
on the antlr one - its pretty clear.

The essential thing is to keep the generated sources separate from the
normal source (for tidyness and ease of source control), so adhere to the
norm of placing the generated source under the build directory, even
something like ${maven.build.dir}/generated-srcs/mygenname would be better,
and have the xslt and xml somewhere under src, e.g. src/main/mygennamexml
and src/main/mygennamexslt

In order to get java:compile to compile your two sets of source at the same
time, you need to understand the java:compile goal.  The java:compile goal
uses an ant pathset variable called "maven.compile.src.set" and compiles
java files on that path set.  This can be done with the following two lines
which must be executed before java:compile.

      <ant:path id="maven.mygenname.compile.src.set"
            location="${maven.build.dir}/generated-srcs/mygenname"/>

      <maven:addPath id="maven.compile.src.set"
                     refid="maven.mygenname.compile.src.set"/>

Hope that helps,
Kris.

----- Original Message ----- 
From: "Jeroen Breedveld" <je...@x-hive.com>
To: <us...@maven.apache.org>
Cc: <je...@frenches.org>
Sent: Tuesday, December 28, 2004 10:19 AM
Subject: RE: generate src with XSLT


>
> || -----Original Message-----
> || From: Jefferson K. French [mailto:jeff@frenches.org]
> || Sent: maandag 27 december 2004 14:56
> || To: Jeroen Breedveld
> || Cc: users@maven.apache.org
> || Subject: Re: generate src with XSLT
> ||
> ||
> || You could generate the sources in a java:compile preGoal as
> || you mention, or you could generate them in a subproject that
> || the rest of your project depends upon. I've done it both
> || ways, but prefer the subproject route because it seems
> || cleaner / more modular to me.
>
> The generated sources and other sources are dependant on each other, right
> now I can't even get them to compile using two <sourceDirectory/>
elements.
> Would it be possible to see them as separate projects?
>
> Thanks and regards,
>
> Jeroen
>
>
>
> ---------------------------------------------------------------------
> 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: generate src with XSLT

Posted by Jeroen Breedveld <je...@x-hive.com>.
|| -----Original Message-----
|| From: Jefferson K. French [mailto:jeff@frenches.org] 
|| Sent: maandag 27 december 2004 14:56
|| To: Jeroen Breedveld
|| Cc: users@maven.apache.org
|| Subject: Re: generate src with XSLT
|| 
|| 
|| You could generate the sources in a java:compile preGoal as 
|| you mention, or you could generate them in a subproject that 
|| the rest of your project depends upon. I've done it both 
|| ways, but prefer the subproject route because it seems 
|| cleaner / more modular to me.

The generated sources and other sources are dependant on each other, right
now I can't even get them to compile using two <sourceDirectory/> elements.
Would it be possible to see them as separate projects?

Thanks and regards,

Jeroen



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


Re: generate src with XSLT

Posted by "Jefferson K. French" <je...@frenches.org>.
You could generate the sources in a java:compile preGoal as you
mention, or you could generate them in a subproject that the rest of
your project depends upon. I've done it both ways, but prefer the
subproject route because it seems cleaner / more modular to me.

I'm not sure if there are any Maven plugins to handle XSLT, but you
can use the jelly:jsl tag lib.

  Jeff

On Mon, 27 Dec 2004, at 13:40:16 [GMT +0100] Jeroen Breedveld wrote:

> Hi all,

> I'm evaluating Maven for an existing Ant built project in our company.
> I'm doing so, basically, by just starting to use it.

> Our project uses sources generated with XSLT that have to be generated
> before all the other sources are compiled because they are dependent on
> it. Is there a default goal that can do this for me or do I have to use
> a <preGoal name="java:compile"> in maven.xml to generate the sources
> myself?

> Thanks and regards,

> Jeroen

> --

> X-Hive Corporation
> e-mail: jeroenb@x-hive.com
> phone: +31 10 2818080
> http://www.x-hive.com 

-- 
mailto:jeff@frenches.org



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