Skip to content

Relocate the Framework

To ensure your plugin works correctly alongside other plugins that might be using different versions of the Command Framework, you must relocate the library into your own package namespace. This process is known as shading and relocating.

Below are the configurations for both Maven and Gradle build systems. Replace your.package.here with your plugin’s unique package path (e.g., com.example.myplugin.libs).

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>dev.despical.commandframework</pattern>
<shadedPattern>your.package.here</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>

If you need to test your plugin quickly without configuring the relocation steps above, you can suppress the framework’s internal warning.

To suppress the warning, add the following flag to your server’s startup command line parameters:

Terminal window
-Dcommandframework.suppress.relocation=true