Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Luke Hutchison edited this page Jun 20, 2019 · 3 revisions

Shading with maven-shade-plugin

It is important to shade both io.github.classgraph. and nonapi.io.github.classgraph., otherwise you may get a ClassCastException when ClassGraph starts up.

<plugin>
  <artifactId>maven-shade-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>shade</goal>
      </goals>
      <configuration>
        <artifactSet>
          <includes>
            <include>io.github.classgraph:classgraph</include>
          </includes>
        </artifactSet>
        <relocations>
          <relocation>
            <pattern>io.github.classgraph.</pattern>
            <shadedPattern>some.prefix.shaded.io.github.classgraph.</shadedPattern>
          </relocation>
          <relocation>
            <pattern>nonapi.io.github.classgraph.</pattern>
            <shadedPattern>some.prefix.shaded.nonapi.io.github.classgraph.</shadedPattern>
          </relocation>
        </relocations>
      </configuration>
    </execution>
  </executions>
</plugin>
Clone this wiki locally
Morty Proxy This is a proxified and sanitized view of the page, visit original site.