Please would you elaborate on where one would place the anttask.properties file?
Although the build.xml was found maven barked about loading the
anttask.properties file.
I simplified the taskdef in build.xml
<taskdef classpath="${depClasspath}" resource="anttask.properties">
</taskdef>
[taskdef] Could not load definitions from resource anttask.properties.
-----Original Message-----
From: Drew Hite [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 15, 2005 2:09 PM
To: Maven Users List
Subject: Re: Classpath in antrun plugin
A few days ago it was stated on this list that the antrun plugin exposes
maven.dependency.classpath to ant as a ref. It can be referenced with:
<property name="depClasspath" refid="maven.dependency.classpath" />
So if you could have something like this in your build.xml
<project default="create_atts">
<property name="src.path" value="src"/>
<taskdef classpath="${depClasspath}"
resource="org/apache/commons/attributes/anttasks.properties">
</taskdef>
<target name="create_atts">
<attribute-compiler destdir="${src.path}">
<fileset dir="${src.path}" />
</attribute-compiler>
</target>
</project>
and something like this in your pom.xml..
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<property name="depClasspath" refid="maven.dependency.classpath" /> <ant
antfile="build.xml" dir="." target="create_atts" inheritRefs="true" /> </tasks>
</configuration> <goals> <goal>run</goal> </goals> </execution> </executions>
</plugin> </plugins> </build>
Seems to work for me...
Drew
On 11/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi Alexandre
>
> Thanks for your reply. This is what I would have assumed would be the
> case but I am not getting this behaviour.
>
> Here is the relevant section of the pom
>
> <dependencies>
> <!-- Dependency for Oracle JDBC -->
> <dependency>
> <groupId>ojdbc</groupId>
> <artifactId>ojdbc</artifactId>
> <version>14</version>
> <scope>compile</scope>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>test</phase>
> <configuration>
> <tasks>
> <ant antfile="build.xml" dir="src/main" target="db-build"
> inheritRefs="true"/> </tasks>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
>
> And this is the task that is being run in the build.xml file
>
> <sql src="oracle/bla_bla_bla.sql"
> classpath="${jdbcfile}"
> driver="${driver}"
> url="${url}"
> userid="${usr}"
> password="${pass}"/>
>
>
> Any ideas?
>
> Steve
>
> Quoting Alexandre Poitras <[EMAIL PROTECTED]>:
>
> >> From what I recall, the classpath seemed to be already set up for
> >> the
> ant
> > plugin, including the dependencies declared in the pom.
> >
> > On 11/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi All
> >>
> >> How do I set up the classpath for ant tasks to contain the
> >> dependencies specified in my POM
> >>
> >> Kind regards
> >>
> >> Stephen
> >>
> >> -------------------------------------------------------------------
> >> --
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Alexandre Poitras
> > Québec, Canada
> >
>
>
>
>
> ---------------------------------------------------------------------
> 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]