maven:addPath does not work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

maven:addPath does not work

Walsh, Richard (Richard)
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 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>

    <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.

Reply | Threaded
Open this post in threaded view
|

Re: maven:addPath does not work

Jason van Zyl
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/plugin.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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: maven:addPath does not work

Walsh, Richard (Richard)
In reply to this post by Walsh, Richard (Richard)
I took the code and changed it to the format suggested. I now have this
in the file.

  <preGoal name="java:compile">
  <ant:path id="maven.javacc.compile.src.set"
            location="${basedir}/build/gen-src"/>
        <maven:addPath id="maven.compile.src.set"
            refid="maven.javacc.compile.src.set"/>
      <ant:property name="maven.src.dirs"
refid="maven.compile.src.set"/>
      <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
  </preGoal>

Here is what is printed. It still does not pick up the build/gen-src
directory.

 __  __
build:start:

java:prepare-filesystem:

java:compile:
<maven:addPath refid="maven.javacc.compile.src.set"
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
BUILD SUCCESSFUL
Total time: 12 seconds
Finished at: Fri May 20 14:41:07 BST 2005

And it still does not to work!. How can I debug this further. Has anyone
else seen this. Attached is the entire maven.xml for you Jason.
Thanks,
Richie.

-----Original Message-----
From: Jason van Zyl [mailto:[hidden email]]
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: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

maven.xml (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: maven:addPath does not work

Walsh, Richard (Richard)
In reply to this post by Walsh, Richard (Richard)
Its ok. I was setting xmlns:maven="maven" at the top instead of
xmlns:maven="jelly:maven"

-----Original Message-----
From: Jason van Zyl [mailto:[hidden email]]
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: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]