|
| 1 | +# srnyx's Java Utilities [](https://jitpack.io/#xyz.srnyx/srnyx-java-utilities) |
| 2 | + |
| 3 | +A general Java utility library for srnyx's projects |
| 4 | + |
| 5 | +### Wiki / Javadocs |
| 6 | + |
| 7 | +- **Wiki:** [github.com/srnyx/srnyx-java-utilities/wiki](https://github.com/srnyx/srnyx-java-utilities/wiki) |
| 8 | +- **Javadocs:** [javadoc.jitpack.io/xyz/srnyx/srnyx-java-utilities/latest/javadoc/index.html](https://javadoc.jitpack.io/xyz/srnyx/srnyx-java-utilities/latest/javadoc/index.html) |
| 9 | + |
| 10 | +## Importing |
| 11 | + |
| 12 | +You can import the library using [Jitpack](https://jitpack.io/#xyz.srnyx/srnyx-java-utilities). Make sure to replace `VERSION` with the version you want. You **MUST** use `implementation`. |
| 13 | + |
| 14 | +- **Gradle Kotlin** (`build.gradle.kts`)**:** |
| 15 | +```kotlin |
| 16 | +// Required plugins |
| 17 | +plugins { |
| 18 | + java |
| 19 | + id("com.github.johnrengelman.shadow") version "8.1.1" // https://github.com/johnrengelman/shadow/releases/latest |
| 20 | +} |
| 21 | +// Jitpack repository |
| 22 | +repositories { |
| 23 | + maven("https://jitpack.io") |
| 24 | +} |
| 25 | +// Lazy Library dependency declaration |
| 26 | +dependencies { |
| 27 | + implementation("xyz.srnyx", "srnyx-java-utilities", "VERSION") |
| 28 | +} |
| 29 | +``` |
| 30 | +- **Gradle Groovy** (`build.gradle`)**:** |
| 31 | +```groovy |
| 32 | +// Required plugins |
| 33 | +plugins { |
| 34 | + id 'java' |
| 35 | + id 'com.github.johnrengelman.shadow' version '8.1.1' // https://github.com/johnrengelman/shadow/releases/latest |
| 36 | +} |
| 37 | +// Jitpack repository |
| 38 | +repositories { |
| 39 | + maven { url = 'https://jitpack.io' } |
| 40 | +} |
| 41 | +// Lazy Library dependency declaration |
| 42 | +dependencies { |
| 43 | + implementation 'xyz.srnyx:srnyx-java-utilities:VERSION' |
| 44 | +} |
| 45 | +``` |
| 46 | +* **Maven** (`pom.xml`)**:** |
| 47 | + * Shade plugin |
| 48 | + ```xml |
| 49 | + <build> |
| 50 | + <plugins> |
| 51 | + <plugin> |
| 52 | + <groupId>org.apache.maven.plugins</groupId> |
| 53 | + <artifactId>maven-shade-plugin</artifactId> |
| 54 | + <version>3.4.1</version> |
| 55 | + <executions> |
| 56 | + <execution> |
| 57 | + <phase>package</phase> |
| 58 | + <goals> |
| 59 | + <goal>shade</goal> |
| 60 | + </goals> |
| 61 | + </execution> |
| 62 | + </executions> |
| 63 | + <!-- Exclude META-INF to avoid conflicts (not sure if this is needed) --> |
| 64 | + <configuration> |
| 65 | + <filters> |
| 66 | + <filter> |
| 67 | + <artifact>xyz.srnyx:*</artifact> |
| 68 | + <excludes> |
| 69 | + <exclude>META-INF/*.MF</exclude> |
| 70 | + </excludes> |
| 71 | + </filter> |
| 72 | + </filters> |
| 73 | + </configuration> |
| 74 | + </plugin> |
| 75 | + </plugins> |
| 76 | + </build> |
| 77 | + ``` |
| 78 | + * Jitpack repository |
| 79 | + ```xml |
| 80 | + <repositories> |
| 81 | + <repository> |
| 82 | + <id>jitpack</id> |
| 83 | + <url>https://jitpack.io</url> |
| 84 | + </repository> |
| 85 | + </repositories> |
| 86 | + ``` |
| 87 | + * Lazy Library dependency declaration |
| 88 | + ```xml |
| 89 | + <dependencies> |
| 90 | + <dependency> |
| 91 | + <groupId>xyz.srnyx</groupId> |
| 92 | + <artifactId>srnyx-java-utilities</artifactId> |
| 93 | + <version>VERSION</version> |
| 94 | + </dependency> |
| 95 | + </dependencies> |
| 96 | + ``` |
0 commit comments