的antlib和classpathref [英] antlib and classpathref

查看:252
本文介绍了的antlib和classpathref的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下build.xml文件:

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.

如果我运行:

ant -lib lib

它的工作原理,但它可能是不错的把一切都build.xml文件里面 - 就像用Groovy和svnant库

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

这可能与Maven的蚂蚁,不知何故tasks.jar?

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

推荐答案

复制两个Maven的蚂蚁任务 - 2.x.x.jar和Maven蚁任务-2.x.x.pom到/ lib目录下。

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

HTTP://search.maven .ORG /#搜索| GA | 1 |一个%3A%22maven蚂蚁任务22%

请注意:了解更多在 http://maven.apache.org/ant-tasks/

这篇关于的antlib和classpathref的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆