添加属性以JAR的Manifest通过Ant任务 [英] Adding Attribute to JAR's Manifest Via ANT TASK

查看:225
本文介绍了添加属性以JAR的Manifest通过Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有我坚持的一个问题。我有14个第三方jars.I我通过Ant任务成功签署与魔岛code标志认证的罐子。

all i am stuck with an issue. I have 14 third party jars.I am signing those jars with comodo code sign certificate successfully via ant task.

现在我要完成,每当我签的罐子我需要一些属性添加到JAR的manifest文件,

我怎样才能做到这一点?

How can i do that ?

我发现jar任务里面的一些明显的任务,但签约时没发现什么。

I found some manifest task inside jar task but did not find anything while signing.

所有这些罐子第三方罐子和包装已经让我觉得不需要编译,并从源头上收拾他们。

all those jars are third party jars and already packed so i think do not need to compile and pack them from the source.

感谢

推荐答案

您很可能必须为每个jar文件做这样的事情:

You'd probably have to do something like this for each jar file:

<unzip src="${jar.file.location}" dest="${manifest.dest.dir}">
    <patternset>
        <include name="**/MANIFEST.MF"/>
    </patternset>
</unzip>

<manifest file="${manifest.dest.dir}/MANIFEST.MF" mode="update">
    <attribute name="${myAttribute}" value="${myAttributeValue}"/>
</manifest>

<jar update="true" destfile="${jar.file.location}" basedir="${manifest.dest.dir}"/>

这篇关于添加属性以JAR的Manifest通过Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆