Closed liplum closed 2 years ago
I think you're making a dependency chain, or graph, in your whole project.
The mindustry.deploy.enableFatJar
will decide whether the jar file of :jar
task includes all runtime classpaths. So it should be execeuted after project evaluated, which results in the problem. Here is a simple explaination: gradle/gradle#10923
As a workaroud temporarily, since this project you mentioned isn't a mod but a library which servers the actual mod project, you have to add the noFatJar
in your mindustry.deploy
:
mindustry {
deploy {
noFatJar
}
}
It will disable the fatJar
, then you won't receive the error.
By the way, I will reconsider a new way for how enableFatJar
works.
After the assessment, I just now developed a new way to cope with this likely common situation. If you have many library modules but have only one mod or more projects, you can add this line into your gradle.properties:
mgpp.deploy.enableFatJar=false
This will disable the fat jar
as default for each project. Thus, in this way, you have to configure all projects which you want them to include the rumtime classpaths, such as kotlin std-lib
, in their build.gradle[.kts], like this:
mindustry {
deploy {
fatJar
}
}
Context
In its the build.gradle.kts, I added some dependencies from other modules in my while project.
Problem
When I sync the gradle in my Intellij IDEA, the problem was ocurred.
My research
When I comment, aka remove, all implementation dependencies of other modules, such as
implementation(project(":annotations"))
, it's solved. But it's unacceptable, I need them.