简体   繁体   English

具有共享实用程序项目的Maven多模块构建

[英]maven multi module build with a shared utility project

Hi I am converting a ear project to Maven. 嗨,我正在将一个耳朵项目转换为Maven。 Below is the structure 下面是结构

-projA-ear -projA-ear

-projA-static -projA-static

-projA-web -projA-web

-shared-util 共享实用程序

The shared util is shared by multiple unrelated projects handled by our team. 共享工具由我们团队处理的多个不相关项目共享。 Currently my deployment assembly is handled by eclipse and the shared-util.jar is automatically built inside the projA-web.war's WEB-INF/lib directory 目前,我的部署程序集是由eclipse处理的,shared-util.jar是自动构建在projA-web.war的WEB-INF / lib目录中的

When I convert my setup to Maven project, I am reading that I need multi module aggregator setup, and need to define shared-util as a module, and then define the aggregator POM as the parent to my modules. 将安装程序转换为Maven项目时,我读到我需要多模块聚合器安装程序,并且需要将shared-util定义为模块,然后将聚合器POM定义为模块的父级。 The problem is I cannot define projA-mvn as parent in the shared-util project as the other projects would be using it too as a module(when they decide to move to maven). 问题是我无法在共享实用程序项目中将projA-mvn定义为父级,因为其他项目也将其用作模块(当他们决定移至maven时)。 Can someone please suggest a solution? 有人可以提出解决方案吗?

1) Make shared-util as a separate standalone Maven project. 1)使shared-util成为一个独立的Maven项目。

2) Put projA-ear, projA-web and projA-static under a separate parent Maven project. 2)将projA-ear,projA-web和projA-static放在单独的父Maven项目下。

3) Declare shared-util jar as a dependency in your projA-web pom. 3)在您的projA-web pom中声明shared-util jar为依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM