失败的原因是什么:“jarsigner:尝试将 {file} 重命名为 {file}.org 失败";用蚂蚁签署罐子时? [英] What is the cause for the failure: "jarsigner: attempt to rename {file} to {file}.org failed" when signing jars with ant?
问题描述
我收到错误:
[signjar] jarsigner:尝试重命名C:\workspace\line_editor\lib\icon.jar到C:\workspace\line_editor\lib\icon.jar.orig失败
[signjar] jarsigner: attempt to rename C:\workspace\line_editor\lib\icon.jar to C:\workspace\line_editor\lib\icon.jar.orig failed
尝试在 Eclipse 中使用 ant 对一组 jar 进行自签名时.ant build 在这个项目中运行良好,在其他项目中也运行了类似的代码.我对代码进行了一些小的更改并尝试重建并不断收到此错误.
when attempting to self sign a set of jars with ant inside Eclipse. The ant build has worked fine in this project and similar code in other projects. I made some small changes to code and tried to rebuild and keep getting this error.
这里是相关的蚂蚁目标:
Here is the related ant target:
<target name="sign" depends="jar" description="Signs Jars">
<genkey keystore="myKeystore1" alias="something" storepass="somethingpass"
dname="CN=Classification, OU=NAPA, O=GPC, C=US"/>
<signjar keystore="myKeystore1" alias="something" storepass="somethingpass">
<fileset file="${web.dir}/${jar.name}" />
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</signjar>
</target>
我删除了该项目并从我们的存储库中再次将其拉下来.因此它与其他项目具有相同的默认项目设置,这部分不会失败.我查看了有问题的 .jar,它不是只读的.我更改了名称,下一个按字母顺序排列的 .jar 文件也失败了.没有正在运行的程序正在访问此文件夹中的 .jars.
I deleted the project and pulled it down again from our repository. So it has the same default project settings as other projects that this part does not fail. I looked at the .jar in question and it was not read-only. I changed the name and the next alphabetical .jar file also failed. There is no program running that is accessing the .jars in this folder.
对原因有什么建议吗?
推荐答案
一种可能性是 jar(位于lib"目录中)位于构建期间正在使用的类路径上.${lib.dir}
是否包含在构建文件中使用的类路径中?
One possibility is that the jar - which is in a 'lib' directory - is on a classpath in use during your build. Is ${lib.dir}
included on a classpath used in the buildfile?
您可以创建一个单独的目录来存放已签名的 jar,并使用 destdir 属性.
You could create a separate directory to deposit signed jars to, and specify that to the 'signjar' task using the destdir attribute.
这篇关于失败的原因是什么:“jarsigner:尝试将 {file} 重命名为 {file}.org 失败";用蚂蚁签署罐子时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!