maven 适合这种情况吗?
我们目前有一个基于 ant 的项目,正在考虑迁移到 Maven。 该项目基于 java ee,但它具有模块结构,其中每个模块可以包含多个 java ee 项目。像这样:
mod1-->subdir-->war-A
-->war-B
mod1->src
mod1->build/classes
添加多个此类模块以及一些 jar 依赖项,并创建一个 EAR 文件。 自定义清单文件
+像这样的
EAR -->war-A
-->war-B
-->war-C
-->war-D
lib/allclasses-from-allmodules-in-one jar
这个结构和依赖项无法更改 - 它来自我们使用的框架。
我对 Maven 的了解不够,无法弄清楚这需要多少工作——或者我们的项目结构和开发实践是否与 Maven 约定相去甚远,以至于不值得花时间。
我意识到你可以让 Maven 做任何你想做的事 - 但如果我们做出改变,应该是为了 Maven 的好处,而不是让生活变得更困难! :)
另一件重要的事情是我希望能够创建分解的ear文件...我需要哪些选项来自定义该方面?如果我进行定制的“任务”,我会放弃什么(我不确定这个的行家术语是什么)
We currently have an ant based project and are contemplating moving to maven.
The project is java ee based, however it has a module structure where each module can contain multiple java ee projects. like this:
mod1-->subdir-->war-A
-->war-B
mod1->src
mod1->build/classes
multiple such modules plus some jars dependencies are added and one EAR file is created.
+ custom manifest file
like so
EAR -->war-A
-->war-B
-->war-C
-->war-D
lib/allclasses-from-allmodules-in-one jar
This structure and dependencies cannot be changed- it comes from a framework that we use.
I don't know enough about maven to figure out how much work this is- or if our project struture and development practices are so far removed from the maven convention that its not worth the time.
I realize you can bend maven to do whatever you want it to -but if we make a switch it should be for the benefits of maven not to make life harder! :)
The other important thing is that I want to be able to create the ear file exploded...what options do I have to customize that aspect ? What will I be giving up if I go with a customized "task" (I'm not sure what the maven term for this is)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
老实说,我不会费心将其移植到 Maven - 尽管我是一个十足的 Maven 粉丝,但我还是这么说。将构建时具有任何复杂性的完整项目转换为 Maven 通常不值得您经历这样的麻烦。
对于新项目或者可能重写这个应用程序(如果它发生的话),我完全建议从 Maven 开始。
你可以“让行家”做任何你想做的事,但通常你这样做是搬起石头砸自己的脚。 maven 的要点在于它是按约定构建,而不是按配置构建。您越冒险去做超出 Maven 生命周期范围的事情,您在构建的维护和可靠性方面就会遇到更多麻烦。
To be perfectly honest, I wouldn't bother with porting this over to maven - and I say this despite being a total maven fanboy. Converting full projects that have any kind of complexity at build time to maven normally isn't worth the trouble you'll undergo.
For new projects or perhaps a rewrite of this app (if it were to ever happen), I would fully suggest starting with maven instead.
You can "bend maven" to do whatever you want, but typically you are shooting yourself in the foot when you do so. The point of maven is that it's a build by convention, not by configuration. The more you venture outside of doing things that fall outside of the scope of the maven lifecycle, the more trouble you are asking for in terms of the maintenance and reliability of your build.
我不能 100% 确定我理解您当前的项目结构,但如果您无法更改任何内容,那么似乎存在重大问题。使用 Maven:
与上述问题相比,不遵循 Maven 默认布局是一个小问题。
如果没有更多关于可以更改的内容(不破坏结构)的详细信息,我只是认为它无法以优雅的方式实现(如果甚至可行)。
I'm not 100% sure I understood your current project structure but if you can't change anything, it looks like there are major show stopper issues. With Maven:
Not following the Maven default layout being a minor problem compared to the above one.
Without more details about what can be changed (without breaking the structure), I simply don't think it's doable in an elegant way (if even doable).