Ezlib
Welcome to Ezlib wiki, here you will find information about the use of this lightweight library.
Introduction
Ezib is a library created to provide an easy way to load dependencies of Java projects at runtime, including support for package relocation.
Requirements
- Minimum Java 8
Dependency
Ezlib it's completely shadeable in your project.
So you can copy the Ezlib class or add it as implementación.
- build.gradle
- build.gradle.kts
- pom.xml
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
repositories {
maven { url 'https://jitpack.io' }
}
// Use only ezlib
dependencies {
implementation 'com.saicone.ezlib:ezlib:VERSION'
}
// Use ezlib loader instead
dependencies {
implementation 'com.saicone.ezlib:loader:VERSION'
// Use annotations
compileOnly 'com.saicone.ezlib:annotations:VERSION'
annotationProcessor 'com.saicone.ezlib:annotations:VERSION'
}
jar.dependsOn (shadowJar)
shadowJar {
relocate 'com.saicone.ezlib', project.group + '.ezlib'
}
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
maven("https://jitpack.io")
}
// Use only ezlib
dependencies {
implementation("com.saicone.ezlib:ezlib:VERSION")
}
// Use ezlib loader instead
dependencies {
implementation("com.saicone.ezlib:loader:VERSION")
// Use annotations
compileOnly("com.saicone.ezlib:annotations:VERSION")
annotationProcessor("com.saicone.ezlib:annotations:VERSION")
}
tasks {
jar {
dependsOn(tasks.shadowJar)
}
shadowJar {
relocate("com.saicone.ezlib", "${project.group}.ezlib")
}
}
<repositories>
<repository>
<id>Jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- Use ezlib -->
<dependency>
<groupId>com.saicone.ezlib</groupId>
<artifactId>ezlib</artifactId>
<version>VERSION</version>
<scope>compile</scope>
</dependency>
<!-- Use ezlib loader -->
<dependency>
<groupId>com.saicone.ezlib</groupId>
<artifactId>loader</artifactId>
<version>VERSION</version>
<scope>compile</scope>
</dependency>
<!-- Use annotations -->
<dependency>
<groupId>com.saicone.ezlib</groupId>
<artifactId>annotations</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<artifactSet>
<includes>
<include>com.saicone.ezlib:ezlib</include>
<include>com.saicone.ezlib:loader</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.saicone.ezlib</pattern>
<shadedPattern>${project.groupId}.ezlib</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</build>