jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifestContentCharset 'utf-8'
metadataCharset 'utf-8'
archivesBaseName = 'code-generator'//基本的文件名
archiveVersion = '1.0.0' //版本
manifest { //配置jar文件的manifest
attributes(
'Main-Class': 'com.tw.CodeGenerateUtils' //指定main方法所在的文件
)
}
//打包依赖包
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}