# MavenLoaderAPI
一个自定义的外部依赖加载器,通过前置加载来轻松减少包大小。
## 需求
- Java 17+
- Velocity 3.3.0 ↔ latest (可选)
- BungeeCord 1.18 ↔ latest (可选)
- Spigot/Paper/Folia 1.18.2 ↔ latest (可选)
## 使用方法
1.4-SNAPSHOT 引入了仓库白名单机制,以尝试避免加载来自不可信仓库的恶意依赖项。
### 服务器
您需要将以下参数添加到 Java 启动参数中才能正常启用它。
```bash
--add-opens=java.base/java.net=ALL-UNNAMED
```
然后下载 MavenLoader 并将其放入服务器插件目录中。 建议保持 MavenLoader 为最新版本。
**请确认依赖 MavenLoaderAPI 的插件是否加载了受信任的依赖项,并注意安全问题。**
### 开发者
文档位于:[DEVELOPER_DOCS](https://github.com/LevelTranic/MavenLoader/blob/main/DEVELOPER_DOCS.md)
更新器 API 位于:[USE_UPDATER](https://github.com/LevelTranic/MavenLoader/blob/main/USE_UPDATER.md)
示例位于:[MavenLoader-Example](https://github.com/LevelTranic/MavenLoader-Example)
## 兼容性
- 1.2-SNAPSHOT: 实现 `maven.yml`
- 1.4-SNAPSHOT: 实现仓库白名单
- 1.5-SNAPSHOT: 支持 Bukkit
- 1.6-SNAPSHOT (即将推出): 支持 BungeeCord, PlugmanX。 `maven.yml` 支持 `platform` 和 `reference-load` 关键字。 移除外部 API (现在仅允许 maven.yml)
## 配置文件
```yaml
enable_whitelist: true # 启用仓库白名单,默认值为 true
# 仓库白名单列表
whitelist:
- https://repo.maven.apache.org/maven2
- https://repo.maven.apache.org/maven2
- https://oss.sonatype.org/content/groups/public/
- https://repository.jboss.org/nexus/content/groups/public
- https://maven-central-asia.storage-download.googleapis.com/maven2/
- https://maven-central-eu.storage-download.googleapis.com/maven2/
- https://maven-central.storage-download.googleapis.com/maven2/
- https://jitpack.io
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
- https://repo.papermc.io/repository/maven-public/
- https://repo.repsy.io/mvn/rdb/default
updater:
check: true
source: github # 更新渠道,支持:github, spigot, spiget
```
## 统计数据
- Velocity: https://bstats.org/plugin/velocity/MavenLoader/23396
- Spigot: https://bstats.org/plugin/bukkit/MavenLoader-Spigot/23501
- Bungee: https://bstats.org/plugin/bungeecord/MavenLoader-Bungee/23524