Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在ant中重用依赖项目?_Java_Ant - Fatal编程技术网

Java 如何在ant中重用依赖项目?

Java 如何在ant中重用依赖项目?,java,ant,Java,Ant,我们有一个项目,包括我们所有的可重用类、第三方库jar等等。这个项目基本上就是我们正在处理的每个项目的所有依赖项的所在。不幸的是,我们只能使用蚂蚁,而不能使用常春藤。例如: ./Common-Project (includes all dependencies -build.xml (will build this project, the dependencies, and package them all into 1 jar) ./Actual-Project (just one o

我们有一个项目,包括我们所有的可重用类、第三方库jar等等。这个项目基本上就是我们正在处理的每个项目的所有依赖项的所在。不幸的是,我们只能使用蚂蚁,而不能使用常春藤。例如:

./Common-Project (includes all dependencies
  -build.xml (will build this project, the dependencies, and package them all into 1 jar)

./Actual-Project (just one of many projects)
  -build.xml (will call the build.xml in common and ensure it gets the latest jar and then copy that jar into its own deployment EAR)
这方面的问题是,当我们构建所有实际项目时(比如全部10个,或者40个,或者其他任何项目),我们每次都会构建一个公共项目


所以,以下是我想知道的。。。。如何打包这个依赖项并确保它实际上是最新的,但不需要不断地重建它?我愿意接受任何建议(只要我们正在做的只是ant)。

默认情况下,javac ant任务只对更新/新的源代码执行。IIRC,建造罐子也有类似的原则。所以,通常情况下,这对你来说不应该是个问题


但是,如果在每次构建之前删除现有jar或
.class
文件,则可能会出现问题。在这种情况下,它将从头开始重复。

这一点很好。我想知道我是否能/应该摆脱“清洁球”任务。是的,对我来说这似乎是第一件要做的事。