Re: Jar task: --module-version and --main-class options

Stefan Bodewig <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
On 2018-10-02, Bruce Alspaugh wrote:

> As requested, I've created a new issue.

Thank you.

> Is there some reason why Ant does not use the JDK's jar tool?

Most of them are historical. For many years the archives created by the
jar tool simply have not really been valid ZIP files - actually
java.util.zip is to blame and forced us to recreate our own zip library.

Ant's <jar> task really mostly is a manifest aware variant of <zip> and
some of the features the task offers (merging manifests while merging
archives) would be difficult to do with the jar command line tool.

And then there is the performance reason which has become less
significant over time. In the earlier years of Ant JVM startup time was
a real problem so you avoided creating new processes by all
means. <javac> runs the compiler inside of the same JVM that is
executing Ant by default for just this reason. IIRC the jar command line
tool didn't offer a stable Java interface you could call into back then
(i.e. Java 1.1 or 1.2).

As I said, most reasons are historical.

Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.