[Asm] 纯文本查看 复制代码 version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
group 'apns2'
version '1.0-SNAPSHOT'
description = """apns_aoetech"""
mainClassName = "com.aoetech.lailiao.apns.Main"
sourceCompatibility = 1.8//JDK的版本为1.7
targetCompatibility = 1.8
repositories {
google()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
mavenCentral()
maven { url "http://repo.maven.apache.org/maven2" }
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jar {
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'com.aoetech.lailiao.apns.Main',
'Class-Path': configurations.runtime.files.collect {"$it.name"}.join(' ')
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
dependencies {
//compile 'org.apache.logging.log4j:log4j-api:2.5'
//compile 'org.apache.logging.log4j:log4j-core:2.5'
//slf4j Bridge to Log4j 2.x
//compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.5'
implementation fileTree(dir:'libs',include:['*.jar'])
implementation group: 'io.netty', name: 'netty-codec-http2', version: '4.1.24.Final'
implementation group: 'io.netty', name: 'netty-handler-proxy', version: '4.1.24.Final'
implementation group: 'io.netty', name: 'netty-resolver-dns', version: '4.1.24.Final'
implementation group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: '2.0.8.Final'
implementation group: 'com.eatthepath', name: 'fast-uuid', version: '0.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.4'
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'ch.qos.logback:logback-core:1.1.7'
implementation 'ch.qos.logback:logback-classic:1.1.7'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
implementation group: 'io.netty', name: 'netty-all', version: '4.1.24.Final'
implementation group: 'redis.clients', name: 'jedis', version: '2.8.2'
// https://mvnrepository.com/artifact/org.json/json
implementation group: 'org.json', name: 'json', version: '20180130'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.47'
// https://mvnrepository.com/artifact/com.meizu.flyme/push-server-sdk
implementation group: 'com.meizu.flyme', name: 'push-server-sdk', version: '1.2.7.20180307_release'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation group: 'com.google.guava', name: 'guava', version: '19.0'
}
配置文件如上 build出来的jar包很小 运行jar就显示无法加载主类 在idea里run是没问题的 没用过gradle 请大佬指教一下
|