I'm a little confused myself.  You want to use the generated path in
an ant "ant" task, right?

I was just trying to demonstrate:
1.  How to build a path including the pom dependencies
and 
2.  How to echo that path should you want to do so

One note:  My choice of the path id as "base.path" was arbitrary.  It
has no special significance.

If you are going use the path in an ant "ant" task from within Maven
the call would tell the new file to inherit the current file's
references with something like

<ant:ant dir="${basedir}" antfile="build.xml" target="all" inheritrefs="true"/>

The "inheritrefs="true" attribute makes references in your current
build file available in the one you call.
(See: http://ant.apache.org/manual/CoreTasks/ant.html )

Then in the ant file you call you could have a "javac" task with something like:

    <javac srcdir="${src}" 
           destdir="${build}"
           fork="true">
      <classpath refid="base.path" /> 
    </javac>       

I hope this helps,
Maury


On Fri, 27 Aug 2004 11:16:26 -0400, Mitch Mattek
<[EMAIL PROTECTED]> wrote:
> Ok, I guess I am just stupid. This isn't working. Yes, it echos a path, but
> it doesn't seem to be using this path to launch ant.
> 
>   <goal name="testme">
>    <a:echo>This is a message.</a:echo>
>    <a:echo>${maven.junit.fork}</a:echo>
>    <a:path id="base.path">
>      <a:pathelement path="${pom.dependencyClasspath}"/>
>      <a:pathelement location="src"/>
>    </a:path>
>    <a:property name="base" refid="base.path"/>
>    <a:echo>${base}</a:echo>
>        <ant:ant dir="${basedir}" antfile="build.xml" target="all"/>
>  </goal>
> 
> Is ant going to use the $[base] as the launch classpath? That's what I want.
> That's what we do now...
> 
> Or do I need to alter all my build files to read this property I've created
> and create a class path...
> 
> 
> 
> -----Original Message-----
> From: Maury Jarrell [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 26, 2004 4:44 PM
> To: Maven Users List
> Subject: Re: Pass classpath to ant
> 
> > Well, that builds an ant file with all the classpath dependencies
> > built into the file. This isn't really what I want. I've got some
> > pretty complex ant files. Initally, the big gain for us would be able
> > to get rid of each project's jars and replace them with maven
> > project.xml files defining dependecies.
> >
> 
> Sorry, I'll read the question a little better next time. Try the following.
> It just worked for me:
> 
>  <goal name="testme">
>    <a:echo>This is a message.</a:echo>
>    <a:echo>${maven.junit.fork}</a:echo>
>    <a:path id="base.path">
>      <a:pathelement path="${pom.dependencyClasspath}"/>
>      <a:pathelement location="src"/>
>    </a:path>
>    <a:property name="base" refid="base.path"/>
>    <a:echo>${base}</a:echo>
>  </goal>
> 
> The variable $pom.dependencyClasspath accesses the
> maven.dependency.classpath.  The tasks after show how to echo it.
> 
> ---------------------------------------------------------------------
> 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]
> 
>

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

Reply via email to