Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

antlib and classpathref

Tags:

classpath

ant

I have the following build.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Minimal" default="default" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
    <path id= "libs.folder" >
         <fileset dir= "lib" >
             <include name= "*.jar" /> 
         </fileset>
    </path>

    <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="libs.folder" /> 
    <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="libs.folder"/>
    <artifact:pom id="pom.file" file="pom.xml" />
    <property name="pom.version" value="${pom.file.version}"/>

   <groovy src="test.groovy">
    <arg line="3"/>
   </groovy>
...

which is located in the following structure:

my-project
  -> lib
     -> maven-ant-tasks.jar
     -> svnant.jar
     -> groovy-all.jar
     -> svnClientAdapter.jar
  -> build.xml
  -> pom.xml
  -> test.groovy

when I run the build file I get:

BUILD FAILED
....\build.xml:18: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:pom
Cause: The name is undefined.
Action: Check the spelling.

If I run with:

ant -lib lib

it works but it could be nice to keep everything inside the build.xml file - like with the groovy and svnant libs.

is this possible with the maven-ant-tasks.jar somehow?

like image 634
u123 Avatar asked Nov 30 '25 10:11

u123


1 Answers

Copy both maven-ant-tasks-2.x.x.jar and maven-ant-tasks-2.x.x.pom to /lib.

http://search.maven.org/#search|ga|1|a%3A%22maven-ant-tasks%22

Note: Read more at http://maven.apache.org/ant-tasks/

like image 188
Ru5 Avatar answered Dec 02 '25 04:12

Ru5



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!