我正在从一个WAR文件中捆绑EAR。JARS放在WARFile/WEB-INF/lib文件夹和EARFile/lib文件夹中。
我们是否需要在WARFile/WEB-INF/lib中已有的EARFile/lib文件夹中再次使用JARS?
如果我们不需要in EAR/lib filder,我们如何删除它们?由于WAR和EAR中都存在重复的WAR,EAR文件的大小增加了一倍。
请帮帮我。
谢谢
发布于 2012-02-29 22:22:45
关于“瘦子”战争的很好的阅读。基本上,您将ear放入ear,而不是war文件:
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
发布于 2012-02-29 22:19:17
您必须以以下方式定义对war项目的依赖关系:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>xyz-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>此外,您必须配置ear插件,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<modules>
<!-- Register our War as a web module, and set the context root -->
<webModule>
<groupId>${project.groupId}</groupId>
<artifactId>xyz-web</artifactId>
<contextRoot>/xyz</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>https://stackoverflow.com/questions/9500289
复制相似问题