简体   繁体   English

ant + yuicompressor路径错误

[英]ant + yuicompressor path error

I've got a file in C:\\Bin\\test.js that I would like to compress and have renamed test-min.js 我在C:\\ Bin \\ test.js中有一个文件,我想压缩并重命名为test-min.js

my ant build.xml looks like this: 我的ant build.xml看起来像这样:

<property name="temp.dir" value="C:\Bin\"/>

<apply executable="java" parallel="false" dest="${temp.dir}">
   <fileset dir="${temp.dir}" includes="test.js"/>
   <arg line="-jar"/>
   <arg path="${yui.dir}"/>
   <srcfile/>
   <arg line="-o"/>
   <mapper type="glob" from="*.js" to="*-min.js"/>
   <targetfile/>
</apply>

I get the following Java error: 我收到以下Java错误:

[apply] java.io.FileNotFoundException: Bintest-min.js:\\Bin\\test.js (The filename, directory name, or volume label syntax is incorrect) [apply] java.io.FileNotFoundException:Bintest-min.js:\\ Bin \\ test.js (文件名,目录名或卷标语法不正确)

I've tried every combination of pathing and filenames I could come up with. 我已经尝试过我可以提出的路径和文件名的每种组合。 What am I missing? 我错过了什么? It looks like it's stripping out C:\\ and the second \\ 看起来它正在剥离C:\\和第二个\\

And I know YUI works because I can do it manually from the command line. 我知道YUI有效,因为我可以从命令行手动完成。

I ran into this problem after upgrading to yuicompressor 2.4.8 升级到yuicompressor 2.4.8后,我遇到了这个问题

There is a knows bug in 2.4.8 where it does not handle the quoted paths generated by ant. 2.4.8中存在一个已知错误,它不处理由ant生成的引用路径。

Going back to 2.4.7 fixed the issue for me. 回到2.4.7为我解决了这个问题。 You can download 2.4.7 here: https://github.com/yui/yuicompressor/downloads 你可以在这里下载2.4.7: https//github.com/yui/yuicompressor/downloads

You can find discussion of the issue here: http://www.yuiblog.com/blog/2013/05/16/yuicompressor-2-4-8-released/ 您可以在此处找到有关该问题的讨论: http//www.yuiblog.com/blog/2013/05/16/yuicompressor-2-4-8-released/

"New version 2.4.8 fails to parse Windows filename in quotes correctly. 2.4.7 works fine. Eg, command java -jar yuicompressor-2.4.8.jar “d:\\work\\common_source.js” –charset utf-8 –disableoptimizations -v -o “d:\\work\\common.js” gives error java.io.FileNotFoundException: workcommon.js:\\work\\coomon_source.js (The filename, directory name, or volume label syntax is incorrect). Unfortunately, this renders it entirely unusable." “新版本2.4.8无法正确解析引用中的Windows文件名.2.4.7工作正常。例如,命令java -jar yuicompressor-2.4.8.jar”d:\\ work \\ common_source.js“-charset utf-8 - disableoptimizations -v -o“d:\\ work \\ common.js”给出错误java.io.FileNotFoundException:workcommon.js:\\ work \\ coomon_source.js(文件名,目录名或卷标语法不正确)。不幸的是,这使它完全无法使用。“

And the YUI Compressor defect is here: https://github.com/yui/yuicompressor/issues/78 YUI Compressor缺陷在这里: https//github.com/yui/yuicompressor/issues/78

我过去遇到过这类问题,请尝试/ Bin

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

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