mabrarov edited a comment on pull request #24: URL: https://github.com/apache/maven-ear-plugin/pull/24#issuecomment-727590153
Proposal for the further work on design of shared libraries inclusion / exclusion (i.e. this comment is not directly related to this pull request). Backward compatible with this pull request and `skinnyWars` option. ```text eartest-war1-xxx.war └───WEB-INF/lib/ ├─── group1-lib1-xxx.jar ├─── group1-lib2-xxx.jar ├─── group2-lib1-xxx.jar ├─── group2-lib2-xxx.jar └─── group2-lib3-xxx.jar eartest-war2-xxx.war └───WEB-INF/lib/ ├─── group1-lib1-xxx.jar ├─── group1-lib2-xxx.jar ├─── group2-lib1-xxx.jar ├─── group2-lib2-xxx.jar └─── group2-lib3-xxx.jar eartest-rar1-xxx.rar ├─── group1-lib1-xxx.jar ├─── group1-lib2-xxx.jar ├─── group2-lib1-xxx.jar ├─── group2-lib2-xxx.jar └─── group2-lib3-xxx.jar eartest-rar2-xxx.rar ├─── group1-lib1-xxx.jar └─── group1-lib2-xxx.jar ``` ```xml <?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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>eartest</groupId> <artifactId>ear</artifactId> <version>xxx</version> <packaging>ear</packaging> <dependencies> <dependency> <groupId>eartest</groupId> <artifactId>war1</artifactId> <version>xxx</version> <type>war</type> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>war1</artifactId> <version>xxx</version> <type>pom</type> <exclusions> <!-- Global exclusion for skinnyWars and skinnyModules --> <exclusion> <groupId>group2</groupId> <artifactId>lib3</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>war2</artifactId> <version>xxx</version> <type>war</type> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>rar1</artifactId> <version>xxx</version> <type>rar</type> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>rar1</artifactId> <version>xxx</version> <type>pom</type> <exclusions> <!-- Global exclusion for skinnyWars and skinnyModules --> <exclusion> <groupId>group2</groupId> <artifactId>lib3</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>rar2</artifactId> <version>xxx</version> <type>rar</type> </dependency> <dependency> <groupId>eartest</groupId> <artifactId>rar2</artifactId> <version>xxx</version> <type>pom</type> <exclusions> <!-- Global exclusion for skinnyWars and skinnyModules --> <exclusion> <groupId>group2</groupId> <artifactId>lib3</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <configuration> <skinnyModules>true</skinnyModules> <modules> <webModule> <groupId>eartest</groupId> <artifactId>war1</artifactId> <sharedLibs> <!-- Used only if skinnyWars or skinnyModules is turned on --> <inlcusions> <inclusion> <groupId>group1</groupId> <artifactId>lib1</artifactId> </inclusion> </inlcusions> </sharedLibs> </webModule> <webModule> <groupId>eartest</groupId> <artifactId>war2</artifactId> <sharedLibs> <!-- Should by non-skinny --> <exclusions> <exclusion> <groupId>*</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </sharedLibs> </webModule> <rarModule> <groupId>eartest</groupId> <artifactId>rar1</artifactId> <sharedLibs> <!-- Used only if skinnyModules is turned on --> <exclusions> <exclusion> <groupId>group2</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </sharedLibs> </rarModule> </modules> </configuration> </plugin> </plugins> </build> </project> ``` ```text eartest-ear-xxx.ear ├─── lib │ ├─── group1-lib1-xxx.jar │ ├─── group1-lib2-xxx.jar │ ├─── group2-lib1-xxx.jar (Why? Because it's among dependencies of eartest:ear) │ └─── group2-lib2-xxx.jar (Why? Because it's among dependencies of eartest:ear) │ ├─── eartest-war1-xxx.war │ └─── WEB-INF/lib/ │ ├─── group1-lib2-xxx.jar │ ├─── group2-lib1-xxx.jar │ ├─── group2-lib2-xxx.jar │ └─── group2-lib3-xxx.jar │ ├─── eartest-war2-xxx.war │ └─── WEB-INF/lib/ │ ├─── group1-lib1-xxx.jar │ ├─── group1-lib2-xxx.jar │ ├─── group2-lib1-xxx.jar │ ├─── group2-lib2-xxx.jar │ └─── group2-lib3-xxx.jar │ ├─── eartest-rar1-xxx.rar │ ├─── group2-lib1-xxx.jar │ ├─── group2-lib2-xxx.jar │ └─── group2-lib3-xxx.jar │ └─── eartest-rar2-xxx.rar ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org