gpt4 book ai didi

java - Ant 覆盖我的manifest.mf文件

转载 作者:行者123 更新时间:2023-12-02 05:38:00 25 4
gpt4 key购买 nike

我有一个 Ant 构建,它构建一个 jar 并最终将其打包到耳朵中。我正在使用 <copy todir....> 从我的一个项目中检索 MANIFEST.MF 文件命令,但是当 ant 创建 jar 文件时,它给了我一个不同的 MANIFEST.MF 文件,有没有办法阻止这种情况发生?

编辑错误如下:

BUILD FAILED
C:\Users\aahmad\Desktop\qa_build_xml_UPTODATE\Ant_Build_Script\build.xml:200: Unable to read manifest file: C:\Users\aahmad\Desktop\qa_build_xml_UPTODATE\Ant_Build_Script\legacy\build\META-INF (C:\Users\aahmad\Desktop\qa_build_xml_UPTODATE\Ant_Build_Script\legacy\build\META-INF (Access is denied))

编辑这是正确的吗?

    <jar jarfile="${myjardirectory}/lib/myjar.jar" basedir="${mybuildpath}" manifest="${mymetainf}" />

最佳答案

是的,jar任务允许您使用 manifest 属性指向 list 文件。

the manifest file to use. This can be either the location of a manifest, or the name of a jar added through a fileset. If its the name of an added jar, the task expects the manifest to be in the jar at META-INF/MANIFEST.MF

请注意,即使您使用此属性指定 list 文件,您仍然可以使用嵌套的 manifest 元素向此 list 添加属性。在这种情况下,两个 list 将被“合并”。

关于java - Ant 覆盖我的manifest.mf文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24788621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com