ant 脚本从 svn上下载文件 的具体步骤,报错
我用的svn 是 svn-1.6.13.zip ,ant 是 apache-ant-1.8.2-bin.zip ,svnant 是 svnant-1.3.1.zip
解压安装成功,用ant 来copy 资源等都是可以的,
也把这么下面几个jar包都扔到 ant 的 lib 目录
svnant.jar , svnClientAdapter.jar , svnjavahl.jar , svnkit.jar
eclipse 里面也导入了这几个jar 包.
但用ant 从svn 下载资源就有问题了,具体如下:
<?xml version="1.0" encoding="UTF-8"?> <!-- Sample build file used to retrieve svnant's sources --> <project name="ant-svn-checkout" basedir="." default="checkoutThis"> <!-- all properties are in build.properties --> <property file="build.properties" /> <!-- path to the svnant libraries. Usually they will be located in ANT_HOME/lib --> <path id="svnant.classpath"> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> </path> <!-- load the svn task --> <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath"/> <target name="checkoutThis"> <svn javahl="true" failonerror="false" username="${svnant.repository.user}" password="${svnant.repository.passwd}"> <checkout url="${svnant.latest.url}" revision="HEAD" destPath="${svnant.dest.url}" /> </svn> </target> </project>
报错信息如下:
Buildfile: D:workspacetestSvnAntbuild.xml
checkoutThis:
[svn] Deprecated attribute 'javahl'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
[svn] Deprecated attribute 'failonerror'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
[svn] Deprecated attribute 'username'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
[svn] Deprecated attribute 'password'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
[svn] Missing 'javahl' dependencies on the classpath !
[svn] the execution failed for some reason. cause: Cannot find javahl, svnkit nor command line svn client
[svn] at org.tigris.subversion.svnant.SvnFacade.getClientAdapter(Unknown Source)
[svn] at org.tigris.subversion.svnant.SvnTask.executeImpl(Unknown Source)
[svn] at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source)
[svn] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[svn] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[svn] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[svn] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[svn] at java.lang.reflect.Method.invoke(Method.java:597)
[svn] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[svn] at org.apache.tools.ant.Task.perform(Task.java:348)
[svn] at org.apache.tools.ant.Target.execute(Target.java:390)
[svn] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[svn] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[svn] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[svn] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[svn] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[svn] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[svn] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[svn] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
BUILD SUCCESSFUL
Total time: 890 milliseconds
我把javahl 改成="false",报Missing 'commandline' dependencies on the classpath ! 其他错跟上面一样,
我再把svn 改成 svnSetting ,它又报不支持 checkout 元素
Buildfile: D:workspacetestSvnAntbuild.xml
checkoutThis:
BUILD FAILED
D:workspacetestSvnAntbuild.xml:15: svnSetting doesn't support the nested "checkout" element.
Total time: 453 milliseconds
我再把checkout 改成 export 还是报不支持 export
Buildfile: D:workspacetestSvnAntbuild.xml
checkoutThis:
BUILD FAILED
D:workspacetestSvnAntbuild.xml:15: svnSetting doesn't support the nested "export" element.
Total time: 438 milliseconds
请大家帮我看看,谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我的配置供参考:
谢谢
要另外下载svnkit 把svant里面的svnkit.jar包去掉,换成下载的svnkit
你好,我想问下这个问题最后解决没
还是不行
我的配置供参考: