Closed ChangruHenryQian closed 1 year ago
@ChangruHenryQian check the timestamp of the two jar files. That might help you diagnose the situation.
@ChangruHenryQian check the timestamp of the two jar files. That might help you diagnose the situation.
Both .jar was created at 12:13. duke.jar was created at 12:13:01 and ip.jar at 12:13:00.
The creation of 2 jar files is because you specified the dependsOn("distZip", "distTar")
in the configuration. So when shadowJar is run, it'll execute these tasks resulting in the creation of the additional ip.jar file.
If you dont need the distribution archives, you can remove the dependsOn("distZip", "distTar")
line from the configuration and it should only generate the duke.jar
file.
Same issue here. + I can't run both jar files
@nixonwidjaja @ChangruHenryQian the recommended gradle settings for shadowjar task can be found in https://se-education.org/guides/tutorials/jar.html
@nixonwidjaja @ChangruHenryQian the recommended gradle settings for shadowjar task can be found in https://se-education.org/guides/tutorials/jar.html
Thank you for helping. I follow this recommended gradle settings for shadowjar, so the current shadowjar block is
shadowJar {
archiveFileName = 'duke.jar'
}
And everything works fine for now.
The creation of 2 jar files is because you specified the
dependsOn("distZip", "distTar")
in the configuration. So when shadowJar is run, it'll execute these tasks resulting in the creation of the additional ip.jar file.If you dont need the distribution archives, you can remove the
dependsOn("distZip", "distTar")
line from the configuration and it should only generate theduke.jar
file.
This fix works for me.
@ChangruHenryQian A gentle reminder to close this issue if the problem has been resolved. If not resolved yet, please post a comment explaining which part of the problem/question remains unresolved.
After running
gradle clean
andgradle shadowJar
, I check thelibs
folder and find two .jar files: duke.jar and ip.jar. Is this situation something I should get or is it a bug?The following is my build.gradle: