Skip to content

How to relocate?

Berke Akçen edited this page Jul 19, 2024 · 1 revision

Table of contents

How to relocate Command Framework?

You should need to relocate CommandFramework to avoid conflicts with other plugin JARs. Here is how you can do it using Maven or Gradle:

Maven

<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>me.despical.commandframework</pattern>
                  <shadedPattern>your.package.here</shadedPattern>
               </relocation>
            </relocations>
         </configuration>
      </execution>
   </executions>
</plugin>

Gradle

plugins {
    id 'com.github.johnrengelman.shadow' version '7.1.2'
}

shadowJar {
    relocate 'me.despical.commandframework', 'your.package.here'
}

Alternative Way

Add -Dcommandframework.suppressrelocation=true to your command line. This should only be used for testing purposes and not for production.