【发布时间】:2021-02-15 16:57:59
【问题描述】:
我正在使用 Eclipse IDE,使用 Kryonet 和 LibGDX 库。
我目前正在尝试制作一个胖 jar 文件 - 使 kryonet 成为一个依赖项。
如何制作大 jar 文件?
这是我的 build.gradle 文件
sourceCompatibility = 1.7
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.resources.srcDirs = ["../core/assets"]
project.ext.mainClassName = "uk.ac.aston.teamproj.game.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../core/assets")
task run(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
}
task debug(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
debug = true
}
task dist(type: Jar) {
manifest {
attributes 'Main-Class': project.mainClassName
}
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
dist.dependsOn classes
eclipse.project.name = appName + "-desktop"
【问题讨论】:
-
有什么问题?
-
如何制作大jar文件?
标签: java eclipse jar libgdx kryonet