Skip to content

Maven Setup

TehBrian edited this page Feb 11, 2021 · 6 revisions

1. get the dependency in your project

RestrictionHelper is published on Maven Central.

Maven Central

Replace [latest version] with the version found above.

<dependency>
    <groupId>xyz.tehbrian</groupId>
    <artifactId>restrictionhelper</artifactId>
    <version>[latest version]</version>
    <scope>provided</scope>
</dependency>

2. shade and relocate the dependency

Replace [your plugin package] with your plugin's package.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.4</version>
            <configuration>
                <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
                </dependencyReducedPomLocation>
                <relocations>
                    <relocation>
                        <pattern>xyz.tehbrian.restrictionhelper</pattern>
                        <shadedPattern>[your plugin package].restrictionhelper</shadedPattern>
                    </relocation>
                </relocations>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Clone this wiki locally