- [Gradle中文教程系列]-跟我学Gradle-7.1:打包-
- gralde 依赖基本知识
- [Gradle中文教程系列]-跟我学Gradle-7.4:打包
- [Gradle中文教程系列]-跟我学Gradle-7.3:打包-
- [Gradle中文教程系列]-跟我学Gradle- 8.6 -
- [Gradle中文教程系列]-跟我学Gradle- 8.5 -
- [Gradle中文教程系列]-跟我学Gradle-使用progu
- [Gradle中文教程系列]-跟我学Gradle-14.2:ec
- [Gradle中文教程系列]-跟我学Gradle-5.1:依赖-
- [Gradle中文教程系列]-跟我学Gradle-5.0:依赖-
过程比较简单,主要是将依赖一起打包到jar中 ,直接撸代码
//基于Gradle 4.1
//pkaq.org
apply plugin: 'java'
def mainClassName = "Tiger"
//仓库
repositories {
maven { url"https://repo.spring.io/libs-release" }
}
//依赖,为了确定依赖都打入jar包,这里随便添加了一个dom4j
dependencies {
compile "dom4j:dom4j:1.6.1"
}
//打包
task runnbaleJar(type: Jar) {
from files(sourceSets.main.output.classesDirs)
from configurations.runtime.asFileTree.files.collect { zipTree(it) }
manifest {
attributes 'Main-Class': mainClassName
}
}
网友评论