我正在从WAR文件中捆绑EAR。 JARS既可以放在WARFile / WEB-INF / lib文件夹中,也可以放在EARFile / lib文件夹中,并且可以复制。
我们是否需要在EARFile / lib文件夹中再次使用JARS,尽管有WARFile / WEB-INF / lib?
如果我们在EAR / lib电影中不需要,我们如何删除它们?由于WAR和EAR中存在重复JAR,EAR文件大小变为两倍。
请帮帮我。
由于
答案 0 :(得分:2)
好好阅读“瘦”战争。基本上,你把罐子放在耳朵里,而不是战争文件:
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
答案 1 :(得分:-3)
您必须按以下方式定义war项目的依赖关系:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>xyz-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
此外,您必须配置如下所示的耳塞:
<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>