Additional transformers for maven-shade-plugin. Some of the provided transformers are based on code contributed to the Gradle’s Shadow plugin originating from the Griffon codebase.
You must add maven-shade-ext-transformers
as a dependency to the the maven-shade-plugin
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<!-- configure transformers -->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.kordamp.shade</groupId>
<artifactId>maven-shade-ext-transformers</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Now specify transformers as needed inside the plugin’s configuration
section.
The following transformers are available in version {version}:
This transformer performs the same task as org.apache.maven.plugins.shade.resource.ServicesResourceTransformer
however
it exposes a configurable path
property, where as the original will always transfom 'META-INF/services'
.
The following example shows the configuration required for processing files in a Griffon application project
<configuration>
<transformer implementation="org.kordamp.shade.resources.ServicesResourceTransformer">
<path>META-INF/griffon</path>
</transformer>
</configuration>
Name | Type | Default |
---|---|---|
path |
String |
|
This transformer can merge properties files using a few strategies when duplicate keys are found. It will automatically merge properties files ending with .properties using first as default merge strategy.
The following example shows the configuration required for processing files in a Griffon application project:
<configuration>
<transformer implementation="org.kordamp.shade.resources.PropertiesFileTransformer">
<paths>
<path>META-INF/editors/java.beans.PropertyEditor</path>
</paths>
</transformer>
</configuration>
Name | Type | Default | Notes |
---|---|---|---|
mappings |
List<Map<String,String>> |
takes precedence over paths |
|
paths |
List<String> |
||
mergeStrategy |
String |
|
valid values are |
mergeSeparator |
String |
|
used when |