构建“直播”的正确方法maven构建后的目录结构?
我有一个多模块 Maven 项目,看起来像:
- main
- 组件一
- 子组件_bob
- 子组件_mike
- 子组件_joe
- component_one_aggregate
- 组件二
- 子组件_tim
- subcomponent_lary
- component_two_aggregate
- 组件一
聚合项目为每个包含其所有子组件的组件创建父 jar。
我在每个目录中都有一个 pom,并将其全部部署到本地存储库。一切都很好!
除了我还想创建“将它们全部联系在一起”的目录结构,例如:
- main
- 部署
- 服务器
- 库
- component_one.jar
- ..其他东西,启动脚本,配置等
- 库
- 客户端
- 库
- component_two.jar
- ...其他东西,启动脚本等
- 库
部署 - 服务器
- 部署
我正在寻找“正确”的方法来做到这一点。
我已经想出了各种 hacky 方法来做到这一点,涉及部署后目标、antrun 等。我只是找不到以“正确”方式实现这一点的证据,这是否超出了 Maven 的范围?
我一直在考虑创建一个 Makefile 来包装 Maven 和一些 bash 脚本来在 Maven 部署后移动文件,但我仍然觉得这也不是一个很好的方法。
我错过了什么?
I have a multi module maven project which looks something like:
- main
- component_one
- subcomponent_bob
- subcomponent_mike
- subcomponent_joe
- component_one_aggregate
- component_two
- subcomponent_tim
- subcomponent_lary
- component_two_aggregate
- component_one
The aggregate projects create parent jars for each of the components containing all of their subcomponents.
I have a pom in each directory, and it all deploys to a local repository. Everything works great!
Except that I would like to have the directory strucuture that "ties it all together" be created as well, something like:
- main
- deploy
- server
- lib
- component_one.jar
- .. other stuff, start scripts, configs, etc
- lib
- client
- lib
- component_two.jar
- ... other stuff, start scripts, etc
- lib
- server
- deploy
I'm looking for the "right" way to do this.
I've figured out a variety of hacky ways to do this involving post deploy goals, antrun, etc. I simply can't find evidence for this being possible in a "correct" way, is this simply outside the scope of maven?
I've been thinking of creating a Makefile to wrap maven and some bash scripts to move the files around post maven deploy, but I still feel like this isn't a great way of doing it either.
What am I misisng?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过 Maven-Assembly-Plugin 创建这样的结构。
You can create such a structure via the Maven-Assembly-Plugin.