l*****a 发帖数: 14598 | 1 本来在一个package里面生成多个jar,但是太费时间
打算分成多个package
但是他们使用一套code base
不同点可以用不同的build.xml
考虑在其他几个package中只包含build.xml..
1这样可行吗?
是不是其他几个package要依赖主package,我只希望build其他package时能得到
主package的code,但不希望它build
2.主package有变化时,有希望trigger其他几个分别build automatically吗?
thanks
java菜鸟 |
s*********n 发帖数: 237 | 2 You need a management tool, such as maven or ant. Either one can build with
selective code (by path, by file pattern, ...). You can make the other
targets depending on the main target. |
l*****a 发帖数: 14598 | 3 now they are in the same package,using ant and build one by one
can I split them into different packages?
since I just want to build them seperately
but if they are in different package, I am afraid that if I just build one
package, it can't find the source of the main package
with
【在 s*********n 的大作中提到】 : You need a management tool, such as maven or ant. Either one can build with : selective code (by path, by file pattern, ...). You can make the other : targets depending on the main target.
|
l*****a 发帖数: 14598 | 4 ding!!!
【在 l*****a 的大作中提到】 : now they are in the same package,using ant and build one by one : can I split them into different packages? : since I just want to build them seperately : but if they are in different package, I am afraid that if I just build one : package, it can't find the source of the main package : : with
|
g*****g 发帖数: 34805 | 5 你的问题最方便的解决方案是ant。ant可以在一个build.xml设置多个target。
比如web module,一个jar,一个war几乎是必然。war可以调用jar的那个target。
就算多个不同的jar,有共同部分,你也可以用zipgroupfileset,include/exclude
等多种办法来达到目的。
当然把代码分到不同项目(eclipse project),用ant+ivy或者maven是比较常见的做法
。 |
J*******n 发帖数: 2901 | 6 主package有变化时,有希望trigger其他几个分别build automatically吗?
你要自动trigger,这个ant做不到吧?一般得用Version control system + CI (git +
jenkins)实现吧 |
g*****g 发帖数: 34805 | 7 Jenkins.
+
【在 J*******n 的大作中提到】 : 主package有变化时,有希望trigger其他几个分别build automatically吗? : 你要自动trigger,这个ant做不到吧?一般得用Version control system + CI (git + : jenkins)实现吧
|
B***r 发帖数: 79 | 8 Maven definitely can handle that with modules:
project1
project2
project3
project1 and project2 can generate their jars that can be used by project3
which creates a war file for the application.
each module has its own pom.xml
It has been used in my company. |