Apache Ant 有没有办法在构建后更新 jar 文件? [英] Is there a way with Apache Ant to update a jar file after it's been built?

查看:19
本文介绍了Apache Ant 有没有办法在构建后更新 jar 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Ant 中更新 jar 文件?

Is there a way to update a jar file in Ant?

例如,如果我想向已经存在的 JAR 文件添加一些额外的文件?

For example, if I wanted to add some additional files to an already existing JAR file?

推荐答案

当然,这完全有可能.Ant Jar task 可以做任何jar 命令行可以做到.您可以将 update 标志设置为 true 而不是 false.

Sure, that's totally possible. The Ant Jar task can do anything the jar command line can do. You do it with the update flag set to true instead of false.

  <jar destfile="/x/y/z/file.jar"
       basedir="/a/b/c/"
       update="true"
  />

目标 jar 已存在于该路径中.

Where the destination jar is already in existence at that path.

设置路径

  <jar destfile="/x/y/z/file.jar"
       update="true">
      <zipfileset dir="/a/b/c"/ prefix="x/y/z" />
  </jar>

这篇关于Apache Ant 有没有办法在构建后更新 jar 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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