简体   繁体   中英

maven ear plugin not copying all jar files from WEB-INF/lib of one of the war

Our product has more four web modules; the maven script of the individual module builds the war file of respective web-modules by bringing all the dependencies as mentioned in pom.xml. We are also doing an overlay of a third-party module that copies additional jar files into WEB-INF/lib folder.

In the end, To simplify the distribution we are trying to create a single enterprise archive (ear) file which includes all war files along with its dependencies.

The maven-ear plugin, we are using copies only the jar files mentioned in pom.xml of sub-modules, not the ones copied by the result of the overlay.

Any help on this much appreciated.

 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>web</artifactId> <groupId>org.dept.prod</groupId> <version>2.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>singleear</artifactId> <version>2.0-SNAPSHOT</version> <packaging>ear</packaging> <properties> <mod.version>7.12.0.Final</mod.version> </properties> <dependencies> <dependency> <groupId>org.dept.prod</groupId> <artifactId>common</artifactId> <version>2.0-SNAPSHOT</version> <type>jar</type> </dependency> <dependency> <groupId>org.dept.prod</groupId> <artifactId>module1</artifactId> <version>2.0-SNAPSHOT</version> <type>war</type> </dependency> <dependency> <groupId>org.dept.prod</groupId> <artifactId>module2</artifactId> <version>2.0-SNAPSHOT</version> <type>war</type> </dependency> <dependency> <groupId>org.dept.prod</groupId> <artifactId>module3</artifactId> <version>2.0-SNAPSHOT</version> <type>war</type> </dependency> <dependency> <groupId>org.dept.prod</groupId> <artifactId>module4</artifactId> <version>2.0-SNAPSHOT</version> <type>war</type> </dependency> <dependency> <groupId>org.3rdparty.module</groupId> <artifactId>other</artifactId> <version>xxxFinal</version> <scope>runtime</scope> </dependency> <!-- Dependencies used by project --> </dependencies> <build> <plugins> <plugin> <artifactId>maven-ear-plugin</artifactId> <version>3.0.2</version> <configuration> <skinnyWars>true</skinnyWars> <defaultLibBundleDir>lib/</defaultLibBundleDir> <modules> <webModule> <groupId>org.dept.prod</groupId> <artifactId>module1</artifactId> <bundleFileName>/module1.war</bundleFileName> <contextRoot>/module1</contextRoot> </webModule> <webModule> <groupId>org.dept.prod</groupId> <artifactId>module2</artifactId> <bundleFileName>/module2.war</bundleFileName> <contextRoot>/module2</contextRoot> </webModule> <webModule> <groupId>org.dept.prod</groupId> <artifactId>module3</artifactId> <bundleFileName>/module3.war</bundleFileName> <contextRoot>/module3</contextRoot> </webModule> <webModule> <groupId>org.dept.prod</groupId> <artifactId>module4</artifactId> <bundleFileName>/module4.war</bundleFileName> <contextRoot>/module4</contextRoot> </webModule> </modules> </configuration> </plugin> </plugins> </build> </project>

<skinnyWars>true</skinnyWars>

此属性不会将库复制到 war 模块中

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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