更改标准打包方式为Fat Jar

This commit is contained in:
MaxKey
2024-04-06 21:09:05 +08:00
parent b091733ff1
commit 95f5ccd446
7 changed files with 192 additions and 167 deletions

View File

@@ -1,4 +1,4 @@
FROM adoptopenjdk:8-jre
FROM openjdk:17-jdk-alpine
RUN mkdir -p /maxkey-openapi
@@ -10,6 +10,6 @@ COPY ${JAR_FILE} maxkey-openapi-boot.jar
EXPOSE 9525
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms256m -Xmx2048m -Djava.security.egd=file:/dev/./urandom"
CMD sleep 60; java -jar maxkey-openapi-boot.jar $JAVA_OPTS

View File

@@ -1,8 +1,44 @@
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
//springboot jar
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'org.springframework.boot' version "${springBootVersion}"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
}
description = "maxkey-web-openapi"
//springboot jar
apply plugin: 'io.spring.dependency-management'
//add support for Java
apply plugin: 'java'
bootJar {
dependsOn jar
archiveBaseName = 'maxkey-openapi-boot'
version = "${project.version}-ga"
mainClass = 'org.dromara.maxkey.MaxKeyOpenApiApplication'
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Vendor": project.vendor,
"Created-By": project.author,
"Implementation-Date": java.time.ZonedDateTime.now(),
"Implementation-Version": project.version
)
}
}
dependencies {
implementation project(":maxkey-common")
implementation project(":maxkey-core")
@@ -18,8 +54,7 @@ dependencies {
implementation project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
implementation project(":maxkey-protocols:maxkey-protocol-saml-2.0")
//rest apis
//webapis
implementation project(":maxkey-web-apis:maxkey-web-api-scim")
implementation project(":maxkey-web-apis:maxkey-web-api-rest")
}
implementation project(":maxkey-web-apis:maxkey-web-api-rest")
}