我在OS X 10.9(Maverick)上使用Grails 2.3.3。我发现,如果使用Finder浏览目录结构,它将在每个目录中创建一个.DS_Store文件(与往常一样)。这导致grails吐出大量错误,因此我想知道是否可以让grails忽略所有.DS_Store文件。
细节如下。
因此,在使用Finder浏览之后,如果我转到“grails test-app”,则会收到大量错误消息和堆栈跟踪。示例(堆栈跟踪用于更多行,因此只是一个示例):
| Error Unable to obtain resource from /Users/Stevenson/grails/testApp/grails-app/.DS_Store:
| Error java.util.zip.ZipException: error in opening zip file
| Error at java.util.zip.ZipFile.open(Native Method)
| Error at java.util.zip.ZipFile.<init>(ZipFile.java:215)
| Error at java.util.zip.ZipFile.<init>(ZipFile.java:145)
| Error at java.util.jar.JarFile.<init>(JarFile.java:153)
| Error at java.util.jar.JarFile.<init>(JarFile.java:117)
| Error at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1006)
| Error at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:887)
仅当它需要重新编译我的一个/任何单元测试时才会发生这种情况-如我所做的更改。而且,当我“grails运行应用程序”时,没有错误报告。
我发现的唯一轻微帮助是该链接(有点不好意思):
https://github.com/beckje01/grails-code-coverage/issues/14
但是,不确定是否仅与Code Coverage插件或Grails有关。
目前,我唯一的解决方案是:
查找整齐的命令:
find . -name '.DS_Store' -exec rm {} +
但是可以肯定,您可以忽略指定的文件。
最佳答案
此错误已针对Grails 2.3.4 as mentioned here修复。 2.3.3的解决方法是:
Also getting this same issue. For me, I simply had to remove a .DS_Store from the root of the project, and the grails-app folder - and at that point all errors went away.
关于grails - 如何让Grails忽略.DS_Store,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20276664/