我需要使用Ant脚本从TFS服务器获取标记文件到另一个工作空间。基本上,我需要构建一个Java项目。我尝试了以下build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="test-teamprise-ant-tasks" basedir="C:/EARs/TFS" default="deploy">
<tstamp/>
<record name="log/build.log.${DSTAMP}${TSTAMP}" action="start" loglevel="verbose" append="true"/>
<property name="ant.lib.dir" value="C:/ant/lib"/>
<property name="tfs.server" value="http://tfsververurl:8080/tfs" />
<property name="tfs_workspace_name" value="TFSWORKSPCENAME"/>
<property name="tfs_project_name" value="$/PROJECT/CODE"/>
<typedef resource="com/teamprise/ant/antlib.xml"
classpath="${ant.lib.dir}/teamprise-ant-1.2.jar" />
<target name="diagnostics">
<tfstasksdiagnostics />
</target>
<target name="get" description="get the codes">
<echo message="Get latest source code from tfs"/>
<tfsget localpath="${basedir}/src" force="false" />
<tfsget localpath="${basedir}/WebRoot" force="false" />
</target>
<target name="deploy" depends="get" description=" get the codes,compile,package and deploy the output file">
<ant antfile="qk.xml"
dir="${basedir}"
inheritall="false"
inheritrefs="false"
target="war"/>
</target>
</project>我收到以下问题:
Problem: failed to create task or type tfsget
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:481)我也在努力从互联网上找到teamprise-ant-1.2.jar。我无法得到它。请帮助我解决这个问题,或向我建议如何使用TFS管理构建。
发布于 2016-02-03 16:13:43
微软的2009年收购的团队。teamprise.com网站似乎已经不可用了,所以很难找到teamprise-ant-1.2.jar的副本。
旧的团队-蚂蚁-1.1.jar的副本可通过互联网档案回车机获得。尽管它是一个较旧的版本,但它支持<tfsget>任务。试一试,看看它是否适合你。
https://stackoverflow.com/questions/35177316
复制相似问题