A low-cost solution of maven repository to get NMS (aka net.minecraft.server) or whatever else dependencies.
I think that deploy the modded Minecraft copy in this way it is OK because codemc also did.
低成本的 Maven 仓库解决方案,用于获取 NMS (也叫做 net.minecraft.server) 或其它什么的依赖。
我觉得以这种方式分发已修改的 Minecraft 副本是可以的,因为 codemc 也干了。
Replace /path/to/nms-repository/local to where local folder in. And replace 1.21.11 to your Minecraft version.
替换 /path/to/nms-repository/local 为 local 文件夹的位置。然后替换 1.21.11 为你的 Minecraft 版本。
java -jar BuildTools.jar --nogui --rev 1.21.11 --remapped --generate-docs --generate-source --compile SPIGOT,CRAFTBUKKIT
cd Bukkit
"..\apache-maven-3.9.6\bin\mvn" deploy -Dmaven.test.skip=true -DaltDeploymentRepository=local::file:///path/to/nms-repository/local
cd ../CraftBukkit
"..\apache-maven-3.9.6\bin\mvn" deploy -Dmaven.test.skip=true -DaltDeploymentRepository=local::file:///path/to/nms-repository/local
cd ../Spigot
"..\apache-maven-3.9.6\bin\mvn" deploy -Dmaven.test.skip=true -DaltDeploymentRepository=local::file:///path/to/nms-repository/localThen commit and push to this repository.
然后提交并推送到这个仓库。
repositories {
val localRepository = File("/path/to/nms-repository/local")
if (localRepository.exists()) {
maven(localRepository.toURI().toString())
}
}<repositories>
<repository>
<id>nms-repository</id>
<url>file:///path/to/nms-repository/local</url>
</repository>
</repositories>