用Ant构建的错误复制文件,"访问被拒绝" [英] Error with Ant build copying files, "Access is denied"

查看:971
本文介绍了用Ant构建的错误复制文件,"访问被拒绝"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在我的Ant构建弹出一个奇怪的错误。构建的工作原理,例如:build.xml中调用一个新buildTargets.xml文件,并在该文件中的大部分工作正在做。 buildTargets.xml将创建GWT-OUT / htdocs中/ **和另一个目录分期/ htdocs中/一堆新文件**。基本上,在GWT-OUT / htdocs目录中创建的文件,然后复制到暂存/ htdocs目录。错误是,只有一个文件不被复制,并且我得到一个java.IO.FileNotFoundException(访问被拒绝)错误。奇怪的是,从生成文件更改构建。

I have a weird bug that is popping up in my Ant build. The build works as such: build.xml calls a new buildTargets.xml file, and in that file most of the work is being done. buildTargets.xml creates a bunch of new files in gwt-out/htdocs/** and another directory staging/htdocs/**. Basically, files are being created in gwt-out/htdocs and then copied into staging/htdocs. The error is that only one file is not being copied, and I am getting a java.IO.FileNotFoundException (Access is denied) error. The weird part is that the file changes from build to build.

起初我以为这是一个Eclipse问题,所以我通过命令行建立,一个新的(不同的文件比日食)没有被放进分期/ htdocs目录,这是产生同样的错误。我什么蚂蚁已与-debug标志表示附后。该错误似乎弹出时,文件将在buildTargets.xml被符号化。周围搜索后似乎最常见的反应是解决我permissions--但该文件正在动态创建的,而当我去检查该文件的所有权限启用(除特),所以我不认为这是个问题。

At first I thought it was an Eclipse problem so I built through the command line, and a new (a different file than eclipse) was not being put into staging/htdocs, which was yielded the same error. I've attached what Ant has said with the -debug flag. The error seems to pop up when the files are being tokenized in buildTargets.xml. After searching around it seems that the most common response was to fix my permissions-- however the file is being dynamically created, and when I go to check on that file all permissions are enabled (except "Special"), so I don't think that's the issue.

其他的SO问题都处理建立一个远程服务器上,并固定我的权限给server--然而,这是所有地方到我的电脑,所以我不知道这是问题无论是。难道是一个错误,在Ant构建复制任务?

Other SO questions similar to mine all deal with building on a remote server and fixing my permissions to that server-- however this is all local to my computer, so I'm not sure that is the issue either. Could it be an error with the copying task in the Ant build?

下面的错误:

BUILD FAILED
C:\CSDK\build\buildTargets.xml:253: Failed to copy C:\Users\admin\worksp
ace\BuildPortal\out\gwt-out\htdocs\war\BuildPortalTest.iOS_Bu
ild_Portal\sc\modules\ISC_DataBinding.js to C:\Users\admin\workspace\BuildPortal
\out\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\m
odules\ISC_DataBinding.js due to java.io.FileNotFoundException C:\Users\admin\wo
rkspace\BuildPortal\out\staging\htdocs\war\BuildPortalTest.iO
S_Build_Portal\sc\modules\ISC_DataBinding.js (Access is denied)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:907)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:563)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.FileNotFoundException: C:\Users\admin\workspace\BuildPortal\o
ut\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\mod
ules\ISC_DataBinding.js (Access is denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)

感谢。

推荐答案

我结束了使用的重试任务,这似乎工作基础断的什么可能走错了以撒的描述。

I ended up using the retry task, and that seemed to work based off of Isaac's description of what was possibly going wrong.

这篇关于用Ant构建的错误复制文件,&QUOT;访问被拒绝&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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