在一个非常大的项目中使用ANT生成一个.jar [英] Using ANT to generate a .jar in a very large project

查看:29
本文介绍了在一个非常大的项目中使用ANT生成一个.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个大型项目(使用 Eclipse),该项目使用 1.5 更新 18 JDK、各种外部 JAR 等.这一切都已在 Eclipse 中正确设置.是否可以创建一个 Ant 文件来从我项目中的特定源文件生成 JAR?(许多源文件可编译为 Java 应用程序.所有这些文件共享大量相同的资源,因此项目工作空间很大).

I have a large project I'm working on (using Eclipse) that uses the 1.5 update 18 JDK, various external JARs, and the like. It's all been setup properly in Eclipse. Is it possible to create an Ant file that generates a JAR from a particular source file in my project? (A number of the source files are compilable into Java Applications. All of those share a lot of the same resources, thus the huge project workspace).

到目前为止,我只能弄清楚如何为整个项目创建 Ant 构建文件,而不是将特定的 .java 文件构建到应用程序中,更不用说从中创建 .jar 了.

So far, I've only been able to figure out how to create an Ant build file for the entire project, not build the specific .java file into an app, let alone create a .jar from it.

感谢大家的帮助!

推荐答案

您可以通过配置 jar 任务来指定要包含在 jar 文件中的文件.您可以通过使用 includesincludesFile 选项进行配置来配置进入 jar 的类文件.请参阅 Jar 任务文档.

You can specify which files to include in a jar file by configuring the jar task. You can configure which class files go into the jar by configuring using the includes and includesFile options. See the Jar task docs.

这篇关于在一个非常大的项目中使用ANT生成一个.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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