/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.2.1/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
// implementation 'com.google.guava:guava:27.0.1-jre'
implementation fileTree(dir: 'libs', include: '*.jar')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.fork = true
options.incremental = true
}
applicationDistribution.from('src/main/resources'){
into "config"
}
// Define the main class for the application
mainClassName = 'com.koal.tele.poc.TelePocTest'
jar {
String runtimePath = ''
configurations.runtime. each {runtimePath = runtimePath + " lib//" +it.name} // 本地lib
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } // implementation 相关的引入解压并打包入新的jar中
}
manifest {
attributes 'Main-Class' : 'com.koal.tele.poc.TelePocTest' // 主类类名
attributes 'Class-Path' : runtimePath
}
//不删除BC库的这些文件会导致jar无法运行
exclude(["META-INF/BC1024KE.DSA","META-INF/BC1024KE.SF","META-INF/BC2048KE.DSA","META-INF/BC2048KE.SF"])
}