简体   繁体   English

无法在TFS位置建立蚂蚁目标

[英]can't build a ant target in TFS location

I have a ant target, xml file in my TFS project folder. 我的TFS项目文件夹中有一个ant目标xml文件。 the project folder is bound with TFS(Team Foundation Server). 项目文件夹与TFS(Team Foundation Server)绑定。 My problem is when ever i try to build the project by running the ant target in that TFS bound location it fails. 我的问题是,当我尝试通过在该TFS绑定位置中运行ant目标来构建项目时,它将失败。 it gives the following failure. 它给出以下故障。

> ria_ant_build.xml:435: Error running C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe  compiler
        at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:508)
        at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        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.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe": CreateProcess erro
r=87, The parameter is incorrect
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at java.lang.Runtime.exec(Runtime.java:593)
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
        at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:505)
        ... 19 more
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
        at java.lang.ProcessImpl.start(ProcessImpl.java:30)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
        ... 24 more

but when i copy the project to a different location and remove the read only attribute from the folder the ant target runs without any error and I'm getting a deploy-able artifact. 但是,当我将项目复制到其他位置并从文件夹中删除只读属性时,ant目标将运行而没有任何错误,并且我得到了可部署的工件。 but even when i remove the read only attribute from the TFS folder i could not build the ant target.It seems like the problem exist on the TFS location it self. 但是即使我从TFS文件夹中删除了只读属性,我也无法构建ant target。似乎问题本身存在于TFS位置上。 :( :(

can some one suggest me a method to solve this problem. 有人可以建议我一种解决此问题的方法吗? I have to stay in the TFS location you guys know the reason i assume :) 我必须留在TFS位置,你们知道我所认为的原因:)

-- Thanks & Regards, Rangana -Rangana致谢

From your question it's hard to figure out what really causes your problem. 从您的问题很难找出真正导致您的问题的原因。

Perhabs, your ant call length is too long and even longer than the max command prompt line (that's 8191 characters in the latest versions of Windows). 也许,您的蚂蚁通话时间太长,甚至比max命令提示符行还长(在最新版本的Windows中为8191个字符)。 As question Fail to launch application (CreateProcess error=87), can't use shorten classpath workaround says you may consider "to shorten folder names, reduce depth of folder trees, using parameter files, etc". 由于问题无法启动应用程序(CreateProcess error = 87),无法使用缩短类路径解决方法 ,您可能会考虑“缩短文件夹名称,减少文件夹树的深度,使用参数文件等”。

Try to run ant with the -debug option to see the specific command-line parameters of your build call inside the TFS workspace. 尝试使用-debug选项运行ant ,以查看TFS工作空间内构建调用的特定命令行参数。 In that way you can estimate the total length of the call. 这样,您可以估计通话的总时长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM