maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Hennessy" <shenne...@astutenetworks.com>
Subject RE: Classpath in antrun plugin
Date Wed, 16 Nov 2005 22:36:01 GMT
Thank you for the clarification.
I missed the dependency for commons attributes in the previous post.
I presumed the classpath already referenced the maven-antrun-plugin jar with anttask.properties
resource therein.
My first attempt using the example resulted in:

[taskdef] Could not load definitions from resource org/apache/commons/attributes/anttasks.properties

That led me to look closer "jar tf maven-antrun-plugin-1.0.jar" and discover no resource so
named.
So I generated an anttask.properties file and shaved down the path for a trial and error attempt..

It remains an exercise of discovery to hunt down the jar that contains the anttask.properties.

Regards,
Sean

-----Original Message-----
From: Drew Hite [mailto:hite.drew@gmail.com] 
Sent: Wednesday, November 16, 2005 1:47 PM
To: Maven Users List
Subject: Re: Classpath in antrun plugin


I think it would need to be in the classpath specified by classpath attribute of the taskdef
tag. So in your case, ${depClasspath} should include the directory where anttask.properties
is found. However, in my experience the anttask.properties files are found in jar files and
your class path needs to include the jar, and in that case you need to make sure you specify
the full path within the jar as in the earlier example that I gave.

HTH,
Drew

On 11/16/05, Sean Hennessy <shennessy@astutenetworks.com> wrote:
>
> Please would you elaborate on where one would place the 
> anttask.propertiesfile?
>
> 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:hite.drew@gmail.com]
> 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, scowx@explosion-it.net <scowx@explosion-it.net> 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 <alexandre.poitras@gmail.com>:
> >
> > >> 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, scowx@explosion-it.net <scowx@explosion-it.net> 
> > > 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: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > Alexandre Poitras
> > > Qu├ębec, Canada
> > >
> >
> >
> >
> >
> > --------------------------------------------------------------------
> > -
> > 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
>
>

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


Mime
View raw message