Its ok. I was setting xmlns:maven="maven" at the top instead of
xmlns:maven="jelly:maven" 

-----Original Message-----
From: Jason van Zyl [mailto:[EMAIL PROTECTED] 
Sent: 20 May 2005 13:22
To: Maven Users List
Subject: Re: maven:addPath does not work

On Fri, 2005-05-20 at 12:30 +0200, Walsh, Richard (Richard) wrote:
> Hi,
> 
> I am having a problem with the below code. The AddPath does not add 
> the src.dirs to the maven.compile.src.set variable.

Here is how it's done in the Antlr plugin:

      <ant:path id="maven.antlr.compile.src.set"
            location="${maven.antlr.target.dir}"/>

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

Where one directory is added at a time. I have honestly never tried
using a multi path reference but maybe give the method employed in the
antlr plugin a quick try.

Reference:

http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/antlr/plug
in.jelly?rev=114791&view=markup

> Here is the goal.
> 
> <preGoal name="java:compile">
> 
>     <ant:path id="src.dirs">
> 
>         <ant:pathelement path="${basedir}/build/gen-src"/>
> 
>         <ant:pathelement path="${basedir}/src"/>
> 
>     </ant:path>

You may also want to try the "location" attribute vs the "path"
attribute. The location is for a single file or directory where the path
takes a list. I never use the path attribute myself. What we are doing
in the AddPath tag may only work with the location attribute.

>     <ant:property name="src.dirs.print" refid="src.dirs"/>
> 
>     <ant:echo>src.dirs=${src.dirs.print}</ant:echo>
> 
>     <maven:addPath id="maven.compile.src.set" refid="src.dirs"/>
> 
>     <ant:property name="maven.src.dirs" 
> refid="maven.compile.src.set"/>
> 
>     <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
> 
> </preGoal>
> 
> The Project.xml file has the ${basedir}/src directory set as the 
> sourceDirectory
> 
> <sourceDirectory>src</sourceDirectory>
> 
> Here is what is printed out when I run
> 
> D:\><basedir>\maven -X java:compile
> 
> __ __
> 
> | \/ |__ _Apache__ ___
> 
> | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
> 
> |_| |_\__,_|\_/\___|_||_| v. 1.0-rc3
> 
> Tag library requested that is not present: 'maven' in plugin: 'null'
> 
> build:start:
> 
> java:prepare-filesystem:
> 
> java:compile:
> 
> [echo]
> src.dirs=D:\builder\Crystal_buildmachine\demo\build\gen-src;D:\builder
> \C
> rystal_buildmachine\demo\src
> 
> <maven:addPath refid="src.dirs"
> id="maven.compile.src.set"></maven:addPath>
> 
> [echo] maven.compile.src.set=D:\builder\Crystal_buildmachine\demo\src
> 
> [echo] Compiling to 
> D:\builder\Crystal_buildmachine\demo/target/classes
> 
> [javac] Compiling 3 source files to
> D:\builder\Crystal_buildmachine\demo\target\classes
> 
>  
> 
> As can be seen the maven.compile.src.set is only set to the 
> ${basedir}/src directory as is being set in the project.xml file. 
> Anyone any ideas.
> 
> thanks,
> 
> Richie.
> 
--
jvz.

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

First, the taking in of scattered particulars under one Idea, so that
everyone understands what is being talked about ... Second, the
separation of the Idea into parts, by dividing it at the joints, as
nature directs, not breaking any limb in half as a bad carver might.

  -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to