-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Asintoto edited this page Aug 19, 2024
·
10 revisions
Here you will find how to include Basic in your Java Plugin in order to use all its features
How to include with Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.Asintotoo</groupId>
<artifactId>Basic</artifactId>
<version>LATERS</version>
<scope>compile</scope>
</dependency>
</dependencies>
Note: Replace "LATEST" with the latest release version avaiable here
Note: Basic requires to be shaded in order to be used in your Minecraft Plugin, please include the following in your pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>com.github.Asintotoo:ColorLib*</include>
<include>com.github.Asintotoo:Basic*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.asintoto.colorlib</pattern>
<shadedPattern>something.unique.libs.colorlib
</shadedPattern>
</relocation>
<relocation>
<pattern>com.asintoto.basic</pattern>
<shadedPattern>something.unique.libs.basic
</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
How to include with Gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Asintotoo:Basic:LATEST'
}
Note: Replace "LATEST" with the latest release version avaiable here
Make sure to shade Basic inside the final jar, to do so, add this to your build.gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version "8.1.1"
}
shadowJar {
mustRunAfter(build)
dependencies {
include(dependency('com.github.Asintotoo:Basic:LATEST'))
}
// Remove the archive classifier suffix
archiveClassifier.set("")
// Relocate dependencies
relocate "com.asintoto.basic", "something.unique.libs.basic"
relocate "com.asintoto.colorlib", "something.unique.libs.colorlib"
// Remove unnecessary files from the jar
minimize()
}
Make sure to run the shadowJar task in order to produce the correct artifact