我是Maven新来的。目前,我正在maven上工作,并创建一个diff模块的单个war文件。我的项目分为四个模块--它们是:
我想在上面提到的模块中制作一个war文件。
请大家帮帮我。
发布于 2016-11-21 06:42:05
假设这是依赖顺序
common -> service -> customer -> Admin含义
Service模块pom.xml包含依赖项,如
<dependeny>
<groupId>com.sample</groupId>
<artifactId>common</artifactId>
</dependeny>同样,对于上述所有模块也是如此。
Admin可以是为您构建war的maven模块。
为此,我们使用战争程序集插件。
使<packaging>war</packaging>用于Admin模块。
如果依赖项以任何其他顺序排列,则在最高模块上指定,所有其他依赖项都作为jar文件添加到WEB-INF文件夹下。
编辑
普通-> pom.xml
<packaging>jar</packaging>服务-> pom.xml
<dependencies>
<dependeny>
<groupId>com.sample</groupId>
<artifactId>common</artifactId>
</dependeny>
</dependencies>
<packaging>jar</packaging>客户-> pom.xml
<dependencies>
<dependeny>
<groupId>com.sample</groupId>
<artifactId>service</artifactId>
</dependeny>
</dependencies>
<packaging>jar</packaging>管理-> pom.xml
<dependencies>
<dependeny>
<groupId>com.sample</groupId>
<artifactId>customer</artifactId>
</dependeny>
</dependencies>
<packaging>war</packaging>这样,您只能创建一个war文件,rest变成jar。
https://stackoverflow.com/questions/40714118
复制相似问题