Using your own Shader implementation

By default, the plugin provide a DefaultShader implementation but with version 1.6 you can use your own implementation.

Create a standard Maven project with your implementation.

Dependency to Plexus annotations

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
      <version>1.5.5</version>
    </dependency>

Create your Shader

@Component( role = Shader.class, hint = "mock" )
public class MockShader
    implements Shader
{
  // implement the interface here
}

// Use the plexus component metadata plugin in your job to generate Plexus metadata

      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <version>1.5.5</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Assuming your project has coordinate org.foo.bar:wine:1.0, you must add it as a dependency of the shade plugin.

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.0</version>
        <dependencies>
          <dependency>
            <groupId>org.foo.bar</groupId>
            <artifactId>wine</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shaderHint>mock</shaderHint>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

Now the mojo will use your own implementation.