Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20.1] 应该如何正确自行编译? #3392

Open
SNWCreations opened this issue Oct 15, 2024 · 11 comments
Open

[1.20.1] 应该如何正确自行编译? #3392

SNWCreations opened this issue Oct 15, 2024 · 11 comments
Labels

Comments

@SNWCreations
Copy link
Contributor

这两天在研究这个项目的工作原理,想自己编译一个出来看看,但是在 IDEA 加载 Gradle 项目的时候失败了。
已经根据 wiki 运行过 "setup" 步骤,在那之后才用 IDEA 打开的项目。
捕获
看起来缺失fork版本的 Forge 组件,已经注意到 MohistMC/maven 仓库中有这些库的集合压缩包,但我不知道怎么使用。
是否应该完善相关wiki条目?或者是我的操作有误?

@Mgazul
Copy link
Contributor

Mgazul commented Oct 15, 2024

检查你的网络和jdk

@SNWCreations
Copy link
Contributor Author

SNWCreations commented Oct 15, 2024 via email

@SNWCreations
Copy link
Contributor Author

确认有代理的问题,但是问题没有完全解决。
看起来在 Mohist Maven 库存放的元数据是错误的?Gradle 拒绝了它。

Execution failed for task ':fmlloader:compileJava'.
> Could not resolve all files for configuration ':fmlloader:compileClasspath'.
   > Could not resolve cpw.mods:securejarhandler:mohist-2.1.11.
     Required by:
         project :fmlloader
      > Could not resolve cpw.mods:securejarhandler:mohist-2.1.11.
         > inconsistent module metadata found. Descriptor: net.minecraftforge:securejarhandler:mohist-2.1.11 Errors: bad group: expected='cpw.mods' found='net.minecraftforge'

@Mgazul
Copy link
Contributor

Mgazul commented Oct 15, 2024

gradlew.bat setup
gradlew.bat packageLibraries
gradlew.bat mohistJar

@SNWCreations
Copy link
Contributor Author

SNWCreations commented Oct 15, 2024

gradlew.bat setup gradlew.bat packageLibraries gradlew.bat mohistJar

仍不生效,同样的错误。感觉是Gradle尝试去某个远程仓库查找而不是本地导致的。

@SNWCreations
Copy link
Contributor Author

SNWCreations commented Oct 16, 2024

强行在Gradle缓存中手工修正了pom文件,但是这不能从源头上彻底解决这个问题,治标不治本。

@SNWCreations
Copy link
Contributor Author

已确认在 Mohist 仓库的 pom 是错误的。 group 确实有误。 cpw.mods != net.minecraftforge

@glowingstone124
Copy link
Contributor

我也遇到了同样的问题,更改build.gradle可以解决这个问题吗

@Mgazul
Copy link
Contributor

Mgazul commented Oct 19, 2024

无法复现 我这里一切正常,构建站也一切正常

@SNWCreations
Copy link
Contributor Author

无法复现 我这里一切正常,构建站也一切正常

建议在一个无任何缓存的环境下全新构建?可能旧有的缓存是正确的,但是新的是错误的。

@SNWCreations
Copy link
Contributor Author

SNWCreations commented Nov 6, 2024

我也遇到了同样的问题,更改build.gradle可以解决这个问题吗

需要手工修正本地的 securejarhandler pom 。
对于我,这个pom在 C:\Users\SNWCreations\.gradle\caches\modules-2\files-2.1\cpw.mods\securejarhandler\mohist-2.1.11\ac3e3f18d2a8d277ad47740a2c5f1efb8f810e7c
其中 pom 的 group 是错误的,改为 cpw.mods 即可。
远程上的 pom 也需要如此修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants