You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

111 lines
2.7 KiB

apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.jib'
apply from: "build-common.gradle"
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web"){
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
}
}
dependencies {
implementation (
"io.sc:io.sc.platform.developer:${platform_version}",
"io.sc:io.sc.platform.app:${platform_version}",
"io.sc:io.sc.platform.security.loginform:${platform_version}",
"io.sc:io.sc.platform.page.config:${rwa_version}",
"io.sc:rwa.params:${rwa_version}",
"io.sc:rwa.report:${rwa_version}",
"io.sc:app.rwa.frontend:${rwa_version}",
project(":irbs.frontend"),
project(":irbs.cust.rating"),
project(":irbs.reports"),
project(":irbs.defaultManager")
)
}
/**
* replace [application.version] in i18n message file
*/
processResources {
filesMatching('**/messages*.properties') {
println 'replace ${version} in [' + it + ']'
filteringCharset = 'iso8859-1'
filter(org.apache.tools.ant.filters.ReplaceTokens, beginToken: '$version', endToken: '',tokens: [version: '' + project.version])
}
doLast{
// 为了能够兼容 eclipse 和 idea 两种开发环境,调整如下:
// 1. 将 environment.properties 文件放在了 src/main/resources 目录中
// 2. 在打包时,将该文件删除
delete "$buildDir/resources/main/running-mode.properties"
}
}
bootWar{
mainClass = "${project.name}.Application"
//launchScript()
manifest {
attributes 'Implementation-Version': archiveVersion,
'Implementation-Title': project.name
}
}
bootJar{
mainClass = "${project.name}.Application"
//launchScript()
manifest {
attributes 'Implementation-Version': archiveVersion,
'Implementation-Title': project.name
}
}
jib {
outputPaths {
tar = "build/libs/${project.name}-${project.version}-image.tar"
}
from {
image = "openjdk:8u342-slim"
//image = "eclipse-temurin:8u382-b05-jdk-focal"
platforms {
platform {
architecture ="arm64"
os ="linux"
}
}
}
to {
image = "${project.name}:${project.version}"
}
extraDirectories {
paths {
path {
from = "build/libs/"
into = "/opt/${project.name}/"
includes = ["${project.name}-${project.version}.war"]
}
}
}
container {
/**
* 设置jvm的启动参数
* user.timezone - 解决Java程序的时区问题
*/
jvmFlags = ["-Duser.timezone=Asia/Shanghai"]
creationTime = "USE_CURRENT_TIMESTAMP"
ports = ["8080"]
entrypoint = [
"java",
"-jar",
"/opt/" + project.name + "/" + project.name + "-" + project.version + ".war",
"--" + project.name + ".home.dir=" + "/opt/" + project.name
]
//entrypoint = "java -version"
//appRoot = "/usr/local/tomcat/webapps/ROOT"
}
}