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.

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:

  1. JVM Startup Parameter

    Terminal window
    -Dcommandframework.suppress.relocation=true
  2. Setting the Property Programmatically

    Alternatively, you may set the system property directly in your plugin’s onEnable method:

    @Override
    public void onEnable() {
    System.setProperty("commandframework.suppress.relocation", "true");
    }