plugins { id 'java' } group 'com.ljsd' version '1.0.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenLocal() mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' compile project(":netty") compile project(":hotfix") compile project(":common") compile("org.javassist:javassist:3.18.2-GA") compile("org.springframework.boot:spring-boot:1.5.9.RELEASE") compile("org.springframework.boot:spring-boot-starter-test:1.5.9.RELEASE") compile("org.springframework.boot:spring-boot-starter-data-redis:1.5.9.RELEASE") compile("io.netty:netty-all:4.0.21.Final") compile("com.google.protobuf:protobuf-java:2.5.0") compile("com.fasterxml.jackson.core:jackson-core:2.3.1") compile("com.fasterxml.jackson.core:jackson-databind:2.3.3") compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4' compile files("${System.properties['java.home']}/../lib/tools.jar") } jar { baseName = 'serverlogic' version = '1.0.0' manifest { attributes 'Main-Class': 'com.ljsd.GameApplication' } } //依赖编译,然后打包JAR task taskJar(type:Jar, dependsOn: compileJava) { from 'build/classes/main' destinationDir = file('build/libs') } //删除lib中的jar task clearJars(type:Delete){ delete 'lib' } task copyJars(type: Copy, dependsOn:clearJars) { from configurations.runtime into 'lib' // 目标位置 }