Using ANT to generate a .jar in a very large project

╄→гoц情女王★ 提交于 2019-12-13 18:06:39

问题


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).

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.

Thanks for all the help!


回答1:


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.



来源:https://stackoverflow.com/questions/869034/using-ant-to-generate-a-jar-in-a-very-large-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!