简体   繁体   English

在大型项目中使用ANT生成.jar

[英]Using ANT to generate a .jar in a very large project

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. 我有一个正在使用Eclipse的大型项目,该项目使用1.5更新18 JDK,各种外部JAR等。 It's all been setup properly in Eclipse. 所有这些都已在Eclipse中正确设置。 Is it possible to create an Ant file that generates a JAR from a particular source file in my project? 是否可以创建一个Ant文件从我项目中的特定源文件生成JAR? (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). (许多源文件可编译到Java应用程序中。所有这些源文件共享许多相同的资源,因此,项目工作空间很大)。

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

Thanks for all the help! 感谢您的所有帮助!

You can specify which files to include in a jar file by configuring the jar task. 您可以通过配置jar任务来指定要包含在jar文件中的文件。 You can configure which class files go into the jar by configuring using the includes and includesFile options. 您可以使用includesincludesFile选项进行配置,从而将哪些类文件配置到jar中。 See the Jar task docs . 请参阅Jar任务文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM