buildscript { repositories { mavenCentral() } } plugins { id 'java' id 'org.sonarqube' version '6.0.1.5171' id 'org.springframework.boot' version '3.5.6' id 'io.spring.dependency-management' version '1.1.7' id 'com.bmuschko.docker-remote-api' version '7.4.0' id 'maven-publish' id 'project-report' id 'build-dashboard' id 'com.github.jk1.dependency-license-report' version '2.9' id 'org.openjfx.javafxplugin' version '0.0.13' } sonarqube { properties { property "sonar.projectKey", "Java-Service-Tree-Framework-Engine-Fire" property "sonar.host.url", "http://www.313.co.kr/sonar" property "sonar.login", "admin" property "sonar.password", "qwe123" } } java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } javadoc { destinationDir = file("${buildDir}/docs/javadoc") } import com.github.jk1.license.render.* import com.github.jk1.license.importer.* licenseReport { outputDir = "$projectDir/build/licenses" projects = [project] + project.subprojects configurations = ['runtimeClasspath'] excludeGroups = ['do.not.want'] excludes = ['moduleGroup:moduleName'] excludeOwnGroup = true excludeBoms = false renderers = [new InventoryHtmlReportRenderer("report.html", "Engine")] allowedLicensesFile = new File("$projectDir/allowed-licenses.json") } import org.apache.tools.ant.taskdefs.condition.Os ext { image = "313devgrp/java-service-tree-framework-engine-fire" repositoryUrl = "http://www.313.co.kr/nexus/repository/ple-releases/" metadataUrl = "${repositoryUrl}313devgrp/Java-Service-Tree-Framework-Engine-Fire/maven-metadata.xml" majorVersion = 26 minorVersion = 4 if (Os.isFamily(Os.FAMILY_WINDOWS)) { println "*** Windows is not support build " } else if (Os.isFamily(Os.FAMILY_MAC)) { println "*** Mac " } else { exec { executable "wget" args "-O", "${projectDir}/metadata.xml", "${metadataUrl}" } } def metadataFile = new XmlSlurper().parse(new File("${projectDir}/metadata.xml")) String latest = metadataFile."versioning"."latest" String versionPrefix = latest.split("-")[0] def (latestMajorVersion, latestMinorVersion, latestPatchVersion) = versionPrefix.tokenize(".") if (majorVersion > latestMajorVersion.toInteger()) { minorVersion = 0 patchVersion = 0 } else if (minorVersion > latestMinorVersion.toInteger()) { patchVersion = 0 } else { patchVersion = latestPatchVersion.toInteger() + 1 } } task printVersion() { doLast { println bootJar.version } } group = "313devgrp" version = "${majorVersion}.${minorVersion}.${patchVersion}" bootJar { version = project.version } task generatePublishInfo { def targetFile = new File("${projectDir}/spinnaker.properties") targetFile.parentFile.mkdirs() targetFile.withWriter("UTF-8") { w -> w.writeLine "groupId = " + project.group w.writeLine "artifactId = " + project.name w.writeLine "version = " + project.version } } publish { dependsOn generatePublishInfo } def getMavenSettingsCredentials = { String userHome = System.getProperty("user.home") File mavenSettings = new File(userHome, ".m2/settings.xml") if (Os.isFamily(Os.FAMILY_WINDOWS)) { if (!mavenSettings.exists()) { mavenSettings = new File("${projectDir}/settings.xml") } } else { if (!mavenSettings.exists()) { mavenSettings = new File("${projectDir}/settings.xml") } } def xmlSlurper = new XmlSlurper() def output = xmlSlurper.parse(mavenSettings) return output."servers"."server" } def getCredentials = { def entries = getMavenSettingsCredentials() for (entry in entries) { if (project.version.endsWith("-SNAPSHOT") && entry."id".text() == "snapshots") { return [username: entry.username.text(), password: entry.password.text()] } else { return [username: entry.username.text(), password: entry.password.text()] } } } publishing { def mvnCredential = getCredentials() repositories { maven { credentials { username mvnCredential["username"] password mvnCredential["password"] } url "${repositoryUrl}" allowInsecureProtocol true } } publications { maven(MavenPublication) { groupId = project.group artifactId = project.name version = project.version artifact bootJar } } } repositories { mavenCentral() maven { url 'http://www.313.co.kr/nexus/repository/ple-releases/' allowInsecureProtocol true } } dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:2025.0.1" } } test { useJUnitPlatform() } dependencies { // Lombok implementation 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testCompileOnly 'org.projectlombok:lombok' // Test testImplementation 'org.assertj:assertj-core:3.11.1' testImplementation 'org.mockito:mockito-inline:4.0.0' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude module: 'junit' } testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock' // Spring Boot implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-web' // Spring Framework implementation 'org.springframework:spring-webflux' // Spring Cloud implementation 'org.springframework.cloud:spring-cloud-starter-config' implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' // OpenFeign HTTP Client implementation 'io.github.openfeign:feign-hc5' // Atlassian JIRA implementation 'com.atlassian.event:atlassian-event:3.0.0' implementation 'com.atlassian.httpclient:atlassian-httpclient-api:2.0.0' implementation 'com.atlassian.httpclient:atlassian-httpclient-library:2.0.0' implementation 'com.atlassian.jira:jira-rest-java-client-api:5.1.6' implementation 'com.atlassian.jira:jira-rest-java-client-app:5.1.6' implementation 'com.atlassian.jira:jira-rest-java-client-core:5.1.6' implementation 'com.atlassian.sal:sal-api:3.0.7' implementation 'io.atlassian.fugue:fugue:4.7.2' implementation 'io.atlassian.util.concurrent:atlassian-util-concurrent:4.0.1' // Apache HTTP Components implementation 'org.apache.httpcomponents:httpasyncclient:4.1.5' implementation 'org.apache.httpcomponents:httpasyncclient-cache:4.1.5' implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'org.apache.httpcomponents:httpclient-cache:4.5.14' implementation 'org.apache.httpcomponents:httpcore-nio:4.4.16' // OpenSearch / Elasticsearch implementation 'org.opensearch.client:opensearch-java:2.7.0' implementation 'org.opensearch.client:opensearch-rest-client:2.11.0' implementation 'org.opensearch.client:spring-data-opensearch:1.7.1' // Redmine implementation 'com.taskadapter:redmine-java-api:4.0.0.rc4' // Micrometer Tracing + Zipkin (Spring Boot 3.x) implementation 'io.micrometer:micrometer-tracing-bridge-brave' implementation 'io.zipkin.reporter2:zipkin-reporter-brave' // Slack implementation 'com.slack.api:slack-api-client:1.25.1' // Swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' // Jackson implementation 'com.fasterxml.jackson.core:jackson-databind' implementation 'com.fasterxml.jackson.core:jackson-annotations' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda' // Utilities implementation 'com.github.penggle:kaptcha:2.3.2' implementation 'com.google.guava:guava:32.0.1-jre' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' implementation 'joda-time:joda-time:2.10.14' implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'org.codehaus.jettison:jettison:1.5.4' implementation 'org.glassfish.jersey.core:jersey-common:2.39.1' implementation 'org.modelmapper:modelmapper:3.1.1' // Netty (macOS) implementation group: 'io.netty', name: 'netty-resolver-dns-native-macos', version: '4.1.73.Final', classifier: 'osx-aarch_64' // https://github.com/gradle/gradle/issues/13656 components { withModule('org.dom4j:dom4j', ClearDependencies) } } // https://github.com/gradle/gradle/issues/13656 class ClearDependencies implements ComponentMetadataRule { @Override void execute(ComponentMetadataContext context) { context.details.allVariants { withDependencies { clear() } } } } import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage import com.bmuschko.gradle.docker.tasks.image.DockerPushImage def jarFile = tasks.bootJar.outputs.files.singleFile def imageName = "313.co.kr:5550/${project.findProperty('image') ?: 'default-image'}:${project.version}" task prepareDockerContext(type: Copy) { dependsOn bootJar from jarFile from 'docker-entrypoint.sh' from "$projectDir/Dockerfile" into "$buildDir/docker" } task buildDockerImage(type: DockerBuildImage) { dependsOn prepareDockerContext inputDir = file("$buildDir/docker") dockerFile = file("$buildDir/docker/Dockerfile") images = [imageName] noCache = true buildArgs = [ 'JAR_FILE' : jarFile.name, 'ENTRY_FILE': 'docker-entrypoint.sh' ] } task pushDockerImage(type: DockerPushImage) { dependsOn buildDockerImage images = [imageName] }