作者:hwydaniel | 来源:互联网 | 2023-10-12 16:29
常见排除依赖自身依赖的jar,实现jar一致性的方式如下
<dependency><groupId>ru.yandex.qatools.ashotgroupId><artifactId>ashotartifactId><version>1.5.2version><exclusions><exclusion><groupId>org.seleniumhq.seleniumgroupId><artifactId>selenium-remote-driverartifactId> exclusion>exclusions>dependency>
排除指定类使用maven-shade-plugin 这个插件,如下排除elastic-job下的几个类,这种方式可以更好的保持依赖包升级的兼容性。
<plugin><groupId>org.apache.maven.pluginsgroupId><artifactId>maven-shade-pluginartifactId><version>2.3version><executions><execution><phase>packagephase><goals><goal>shadegoal>goals><configuration><filters><filter><artifact>com.dangdang:elastic-job-lite-coreartifact><excludes><exclude>com/dangdang/ddframe/job/lite/api/JobSchedulerexclude><exclude>com/dangdang/ddframe/job/lite/internal/schedule/SchedulerFacadeexclude><exclude>com/dangdang/ddframe/job/lite/config/LiteJobConfigurationexclude><exclude>com/dangdang/ddframe/job/lite/internal/config/LiteJobConfigurationGsonFactoryexclude>excludes>filter><filter><artifact>com.dangdang:elastic-job-lite-lifecycleartifact><excludes><exclude>com/dangdang/ddframe/job/lite/lifecycle/domain/JobSettingsexclude><exclude>com/dangdang/ddframe/job/lite/lifecycle/internal/settings/JobSettingsAPIImplexclude>excludes>filter>filters>configuration>execution>executions>plugin>