You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -149,20 +156,46 @@ KPaperGradle wires a few build steps into your project:
149
156
-`RegisterManager` — scans your `registrationBasePackage` for `CommandBuilder` and `Listener` classes
150
157
-`DependencyLoader` — resolves and attaches declared libraries at runtime via Paper's `MavenLibraryResolver`
151
158
- Registration behavior: Commands are auto-registered; listeners are discovered but must be registered manually via `RegisterManager.registerListeners(plugin)`
152
-
- Creates `.dependencies` under `build/generated-resources/` and copies it into `build/resources/main/`
159
+
- Creates `.dependencies` under `build/generated-resources/` and copies it into `build/resources/main/`. If you declare custom repositories, also creates `.repositories` and copies it alongside
153
160
- Patches `paper-plugin.yml` to add `loader` and `bootstrapper` if missing
154
161
- Adds `cc.modlabs:KPaper:<version>` to the `api` configuration
155
162
- Ensures Java/Kotlin compilation depends on the generation task and sees the generated sources
156
163
157
164
## 🔧 Configuration
158
165
159
-
The `kpaper` extension exposes the following properties:
166
+
The `kpaper` extension exposes the following properties and DSL helpers:
160
167
161
168
-`javaVersion: Property<Int>` — Java toolchain and `--release` (default `21`)
162
169
-`registrationBasePackage: Property<String>` — base package to scan (default `"cc.modlabs"`)
163
170
-`deliver(vararg deps: String)` — declare runtime libraries, e.g. `deliver("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")`
171
+
-`repository(url: String)` — add a Maven repository used by the runtime dependency loader; an id is inferred from the URL host
172
+
-`repository(id: String, url: String)` — same as above but with an explicit id
173
+
174
+
Notes:
175
+
- These repositories are used only by the generated runtime loader (`MavenLibraryResolver`) to resolve delivered libraries on the server. They do not affect Gradle resolution.
176
+
- The ModLabs mirror `https://nexus.modlabs.cc/repository/maven-mirrors/` is always added by default.
177
+
178
+
## 🌐 Custom repositories for dependency delivery
179
+
180
+
You can declare additional Maven repositories that the runtime dependency loader will use when resolving libraries from your `deliver(...)` block. Example:
181
+
182
+
```kotlin
183
+
kpaper {
184
+
deliver("com.squareup.okio:okio:3.9.0")
185
+
186
+
// Add Maven Central explicitly (id inferred from host)
Under the hood, the plugin writes a `.repositories` file next to `.dependencies` in your built resources. The generated runtime `DependencyLoader` reads this file and appends each entry to the `MavenLibraryResolver`.
164
195
165
-
Environment variables (for building this Gradle plugin itself):
196
+
Accepted `.repositories` line formats:
197
+
-`url` (id inferred from host), e.g. `https://repo1.maven.org/maven2/`
198
+
-`id url`, e.g. `papermc https://repo.papermc.io/repository/maven-public/`
166
199
167
200
-`KPAPER_VERSION` — pinned KPaper version embedded into the plugin (falls back to a timestamped default)
168
201
-`VERSION_OVERRIDE` — override the plugin’s published version
0 commit comments