I found another solution, the Maven dependency has an exclusive function, and I use it to delete some jar files.
<dependencies> <dependency> <groupId>com.example</groupId> <artifactId>ejb-project</artifactId> <version>1.0-SNAPSHOT</version> <type>ejb-client</type> <exclusions> <exclusion> <groupId>sample.ProjectD</groupId> <artifactId>Project-D</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
source share