plugins { id 'java' id 'org.openjfx.javafxplugin' version '0.0.5' } apply plugin: 'java' apply plugin: 'org.openjfx.javafxplugin' group 'pkusz' version '0.1' sourceCompatibility = 11 targetCompatibility = 11 //指定编译编码 tasks.withType(JavaCompile){ options.encoding="UTF-8" } repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} // mavenCentral() } dependencies { // compile files('lib/controlsfx-8.0.6_20.jar') testCompile group: 'junit', name: 'junit', version: '4.12' compile fileTree(dir: 'lib',includes: ['*jar']) compile 'com.blankj:utilcode:1.10.0' } javafx { version = "11.0.2" modules = [ 'javafx.controls','javafx.fxml' ] } jar{ manifestContentCharset 'utf-8' metadataCharset 'utf-8' manifest{ attributes "Main-Class": "cn.minoa.Main" } from{ configurations.compile.collect{it.isDirectory()?it:zipTree(it)} } }