我在我的 OSX 10.7.5 上与 Debian 并行运行,我已经将一个包含 Java 源代码的目录从 OSX 链接到虚拟 Debian 机器(使用 Parallels 工具,它将目录挂载到 /media/psf/
)。
编译工作正常,我遇到的唯一问题是 Maven Assembly 插件:它提示:
Failed to retrieve numeric file attributes using: '/bin/sh -c ls -1nlaR
我用谷歌搜索了以下问题:http://jira.codehaus.org/browse/MASSEMBLY-588
他们建议使用 <directory>${baseDir}</directory>
在 jarlib.xml
.通过此修改,代码可以编译,但是在使用 jar tf file.jar
检查内容时, 它完全缺少所有编译源,只添加了 maven 库。
在本地文件系统上可以正常工作的文件是:
<assembly>
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
有没有办法解决这个问题?
编辑:
Apache Maven 2.2.1 (rdebian-4)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-5-amd64" arch: "amd64" Family: "unix"
最佳答案
/bin/sh -c ls -1nlaR {目录结构/文件}
我通过重命名 directory_structure 中带有撇号 (') 的文件夹解决了这个问题。
这个问题是因为 maven 程序集在执行命令/bin/sh -c ls -1nlaR {directory_structure/file} 时没有转义撇号 (')。
关于java - Maven 程序集插件 : Failed to retrieve numeric file attributes using: '/bin/sh -c ls -1nlaR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13568017/