Skip to content

Instantly share code, notes, and snippets.

@prb112
Last active April 6, 2020 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prb112/3f330c3a88e8f2c90566db24a0ae6338 to your computer and use it in GitHub Desktop.
Save prb112/3f330c3a88e8f2c90566db24a0ae6338 to your computer and use it in GitHub Desktop.
Shading to use with a new model
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>resource-model-old</artifactId>
<version>3.0.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.internal.model</pattern>
<shadedPattern>com.internal.model.old</shadedPattern>
<includes>
<include>**</include>
</includes>
<excludes>
</excludes>
</relocation>
<relocation>
<pattern>com.internal.model.core</pattern>
<shadedPattern>com.internal.model.core.old</shadedPattern>
<includes>
<include>**</include>
</includes>
<excludes>
</excludes>
</relocation>
</relocations>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>example:resource-model</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>example:core</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>resource-model</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment