点击build进行打包
打包好的jar包文件
在jar块中加上rootProject.version = getNewVersionValue(),getNewVersionValue()为自己定义的格式
buildscript {
ext {
springBootVersion = '2.1.2.RELEASE'
}
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
rootProject.version = getNewVersionValue()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
allprojects {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}
}
/*ext['thymeleaf.version'] = '3.0.2.RELEASE'
ext['thymeleaf-layout-dialect.version'] = '2.0.5'*/
dependencies {
compile project(":zndzXytCommon")
compile fileTree(dir: 'lib', include: ['*.jar'])
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
//获取新的版本号
def getNewVersionValue() {
//用日期作为版本号
return new Date().format("yyyyMMdd-HHmm", TimeZone.getTimeZone("GMT+08:00"))
}