| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- ext['log4j2.version'] = '2.17.1'
- buildscript {
- ext.'springBootVersion' = '2.7.7'
- repositories {
- maven {
- url "https://fridaytest-maven.pkg.coding.net/repository/fridaybase/pkg01/"
- credentials {
- username = 'pkg01-1686567454885'
- password = 'aab1a3dd6a0db74bfb0c67b9d2f702999ef23c2a'
- }
- }
- maven {
- url "https://fridaytest-maven.pkg.coding.net/repository/fridaybase/package"
- credentials {
- username = 'package-1686022569525'
- password = '6c814e8d1c53f904bf1014bedb626d1894066db6'
- }
- }
- }
- dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
- classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2")
- }
- }
- allprojects {
- apply plugin: "idea"
- apply plugin: 'eclipse'
- apply plugin: 'java'
- apply plugin: 'org.springframework.boot'
- apply plugin: 'io.spring.dependency-management'
- apply plugin: 'maven'
- apply plugin: "jacoco"
- group = 'com.friday.mystery'
- version = '1.0.0'
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- ext.'log4j2.version' = '2.16.0'
- idea {
- module {
- inheritOutputDirs = true
- }
- }
- tasks.withType(JavaCompile) {
- options.encoding = "UTF-8"
- }
- [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
- configurations {
- compile.exclude module: 'spring-boot-starter-logging'
- }
- repositories {
- mavenLocal()
- maven {
- url "https://fridaytest-maven.pkg.coding.net/repository/fridaybase/pkg01/"
- credentials {
- username = 'pkg01-1686567454885'
- password = 'aab1a3dd6a0db74bfb0c67b9d2f702999ef23c2a'
- }
- }
- maven {
- url "https://fridaytest-maven.pkg.coding.net/repository/fridaymystery/pkg01/"
- credentials {
- username = 'pkg01-1687190637357'
- password = '92b8b418d1d7afbf4641165ce7ea1c130e3f7b16'
- }
- }
- maven {
- url "https://fridaytest-maven.pkg.coding.net/repository/fridaybase/package"
- credentials {
- username = 'package-1686022569525'
- password = '6c814e8d1c53f904bf1014bedb626d1894066db6'
- }
- }
- }
- }
- subprojects {
- bootJar { enabled = true }
- jar { enabled = true }
- dependencies {
- compile('org.springframework.boot:spring-boot-starter')
- compile('org.yaml:snakeyaml:1.32')
- compile('com.fasterxml.jackson.core:jackson-databind:2.14.1')
- compile('org.springframework.boot:spring-boot-starter-aop')
- compile('org.springframework.boot:spring-boot-configuration-processor')
- compile('org.springframework.boot:spring-boot-starter-log4j2')
- compile('com.alibaba:fastjson:1.2.83')
- compile('org.apache.commons:commons-lang3:3.7')
- compile('com.google.guava:guava:27.0-jre')
- compile('com.github.ulisesbocchio:jasypt-spring-boot-starter:2.1.1')
- compile('log4j:log4j:1.2.17')
- annotationProcessor('org.projectlombok:lombok')
- compileOnly('org.projectlombok:lombok')
- /*测试类依赖*/
- testImplementation('org.springframework.boot:spring-boot-starter-test')
- testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
- testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.4'
- testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'
- testImplementation group: 'org.powermock', name: 'powermock-classloading-xstream', version: '1.7.4'
- testImplementation group: 'org.powermock', name: 'powermock-module-junit4-rule', version: '1.7.4'
- testImplementation group: 'org.powermock', name: 'powermock-module-junit4-rule-agent', version: '1.7.4'
- testImplementation group: 'junit', name: 'junit', version: '4.12'
- }
- }
- def buildTime() {
- return new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
- }
- def buildIP() {
- InetAddress result = null;
- Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
- while (interfaces.hasMoreElements()) {
- Enumeration<InetAddress> addresses = interfaces.nextElement().getInetAddresses();
- while (addresses.hasMoreElements()) {
- InetAddress address = addresses.nextElement();
- if (!address.isLoopbackAddress()) {
- if (address.isSiteLocalAddress()) {
- return address.getHostAddress();
- } else if (result == null) {
- result = address;
- }
- }
- }
- }
- return (result != null ? result : InetAddress.getLocalHost()).getHostAddress();
- }
- def gitShow() {
- return 'git show --stat'.execute().text.trim()
- }
- def gitUrl() {
- return 'git config remote.origin.url'.execute().text.trim()
- }
- def gitBranch() {
- return 'git symbolic-ref --short -q HEAD'.execute().text.trim()
- }
- def buildLog() {
- File path = new File("build/dist")
- if (!path.exists()) {
- path.mkdirs()
- }
- FileWriter fw = new FileWriter("build/dist/ibpms.RELEASE_NOTES")
- StringBuilder builder = new StringBuilder()
- builder.append("AppName: ibpms")
- builder.append("\r\n")
- builder.append("Version: $version")
- builder.append("\r\n")
- builder.append("GitUrl: " + gitUrl())
- builder.append("\r\n")
- builder.append("GitBranch: " + gitBranch())
- builder.append("\r\n")
- builder.append("Build IP: " + buildIP())
- builder.append("\r\n")
- builder.append("Build Time: " + buildTime())
- builder.append("\r\n")
- builder.append("\r\n")
- builder.append("*************** Git Commit Information ***************")
- builder.append("\r\n")
- builder.append(gitShow())
- builder.append("\r\n")
- builder.append("*************** Git Commit Information ***************")
- builder.append("\r\n")
- fw.write(builder.toString())
- fw.flush()
- fw.close()
- }
|