我有一个包含3个模块的maven项目。两个在构建时生成jar的项目,以及一个构建WAR文件的项目。生成的WAR文件将所有依赖项jar复制到其WEB-INF/lib
目录中。而其他项目使用的库不包括在内。如何配置maven项目以将其他jar文件复制到WAR?
父pom.xml
<project>
<....>
<modelVersion>4.0.0</modelVersion>
<groupId>company.project</groupId>
<artifactId>project</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>project-service</module>
<module>project-api</module>
<module>project-platform</module>
</modules>
<properties>
<java.version>1.8</java.version>
<slf4j.version>1.7.2</slf4j.version>
<junit.version>4.11</junit.version>
<spring.version>4.1.6.RELEASE</spring.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
web项目pom.xml
<dependency>
<groupId>company.project</groupId>
<artifactId>project-service</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>company.project</groupId>
<artifactId>project-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>