maven-shade-plugin 必须和 Maven 构建生命周期的 package 阶段绑定,那么当 Maven 执行mvn package时会自动触发 maven-shade-plugin;使用很简单,在pom.xml添加该插件依赖即可 <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><version>3.6.0</version><executions><...
在上述配置中,我们使用<exclude>标签指定了需要排除的JAR文件的坐标,其中groupId表示JAR文件的组织ID,B表示JAR文件的Artifact ID。这样,在执行maven-shade-plugin的打包命令时,B.jar将会被排除在最终生成的JAR文件之外。 maven-shade-plugin的排除功能可以帮助我们解决一些常见的问题,例如避免冲突的依赖项、减小最终生成...
这是官网直译的标题,用我们容易理解的就是通过shade插件我们可以为生成的那个jar包选择包含哪些依赖以及排除哪些依赖。 1. 支持两种操作include和exclude 2. 配置格式:groupId:artifactId[[:type]:classifier],至少包含groupid和artifactid,type和类名可选 3. 支持’*’ 和‘?’执行通配符匹配 ——— 版权声明:本...
maven-shade-plugin 必须和 Maven 构建生命周期的 package 阶段绑定,那么当 Maven 执行mvn package时会自动触发 maven-shade-plugin;使用很简单,在pom.xml添加该插件依赖即可 代码语言:javascript 复制 <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><version>3.6....
maven-shade-plugin 必须和 Maven 构建生命周期的 package 阶段绑定,那么当 Maven 执行mvn package时会自动触发 maven-shade-plugin;使用很简单,在pom.xml添加该插件依赖即可 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> ...
1. maven-shade-plugin(常用) 可以将依赖打进jar包里面,只有一个插件目标shade:shade,通常绑定在package生命周期阶段。 1.1 包含或过滤jar包 <artifactSet> <excludes> <exclude>junit:junit</exclude> </excludes> <includes> <include>com.alibaba:fastjson</include> ...
再试一下,问题确实解决了。但是如果代码变为String value = "redis.clients";,那么还是会重复之前的问题,所以这是一个注意事项:使用 maven-shade-plugin 时需要小心处理字符串。 我们需要看一下maven-shade-plugin 的源码。 总的来说就是使用asm,我们找到相关的RelocatorRemapper: ...
maven-shade-plugin编译插件 打包package的时候警告:Discovered module-info.class. Shading will break its strong encapsulation. 问题原因:maven-shade-plugin缺少配置 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" ...
maven-shade-plugin插件可以配置自动精简那些项目没有用到的依赖的artifact,或者显式的配置精简项目用到的依赖的artifact下面没有用到的classes。 <project>...<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><version>3.2.1</version><executions...
<artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> ...