Skip to content

Commit 8ee2654

Browse files
committed
add publish package, docker file update, yml refactoring.
1 parent 0af008b commit 8ee2654

File tree

4 files changed

+81
-22
lines changed

4 files changed

+81
-22
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM gradle:7.6.1-jdk17-alpine AS build
1+
FROM gradle:8.6.0-jdk21-alpine AS build
22
COPY --chown=gradle:gradle . /home/app
33
WORKDIR /home/app
44
RUN gradle clean build --no-daemon -i -x test -x javadoc
55

6-
FROM eclipse-temurin:17-jre-alpine
6+
FROM eclipse-temurin:21-jre-alpine
77
COPY --from=build /home/app/ss-web/build/libs/ss-web.jar /usr/local/lib/sw/app.jar
88
RUN apk update && apk upgrade libssl3 libcrypto3
99
RUN addgroup -S sw && adduser -S sw -G sw

ss-api/build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'jacoco'
4+
id 'maven-publish'
45
}
56

67

@@ -25,4 +26,23 @@ dependencyManagement {
2526
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
2627
mavenBom("org.testcontainers:testcontainers-bom:${testContainerVersion}")
2728
}
28-
}
29+
}
30+
publishing {
31+
repositories {
32+
maven {
33+
name = "GitHubPackages"
34+
url = "https://maven.pkg.github.com/smartSenseSolutions/spring-boot-multi-module-boiler-plate"
35+
credentials {
36+
username = System.getenv("GITHUB_USERNAME")
37+
password = System.getenv("GITHUB_TOKEN")
38+
}
39+
}
40+
}
41+
publications {
42+
gpr(MavenPublication) {
43+
from components.java
44+
groupId = 'ss.mod.demo.api'
45+
version = '0.1'
46+
}
47+
}
48+
}

ss-service/build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'jacoco'
4+
id 'maven-publish'
45
}
56

67

@@ -18,4 +19,23 @@ dependencyManagement {
1819
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
1920
mavenBom("org.testcontainers:testcontainers-bom:${testContainerVersion}")
2021
}
21-
}
22+
}
23+
publishing {
24+
repositories {
25+
maven {
26+
name = "GitHubPackages"
27+
url = "https://maven.pkg.github.com/smartSenseSolutions/spring-boot-multi-module-boiler-plate"
28+
credentials {
29+
username = System.getenv("GITHUB_USERNAME")
30+
password = System.getenv("GITHUB_TOKEN")
31+
}
32+
}
33+
}
34+
publications {
35+
gpr(MavenPublication) {
36+
from components.java
37+
groupId = 'ss.mod.demo.service'
38+
version = '0.1'
39+
}
40+
}
41+
}

ss-web/src/main/resources/application.yml

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,38 @@ app:
22
name: Multi-module Demo
33
description: Seed multi-module project
44
version: 1
5+
port: ${APP_PORT:8080}
56
security:
6-
enabled: ${SECURITY_ENABLE:false}
7-
realm: ${KEYCLOAK_REALM_NAME:master}
8-
clientId: ${KEYCLOAK_CLIENT_ID:swd_public_client}
9-
roleClientId: ${KEYCLOAK_ROLE_CLIENT_ID:swd_public_client}
10-
auth-server-url: ${KEYCLOAK_AUTH_URL:https://auth.dev.smart-x.smartsenselabs.com}
7+
enabled: ${SECURITY_ENABLE:true}
8+
realm: ${KEYCLOAK_REALM_NAME:SWD}
9+
clientId: ${KEYCLOAK_CLIENT_ID:pb_backend}
10+
roleClientId: ${KEYCLOAK_ROLE_CLIENT_ID:pv_backend}
11+
auth-server-url: ${KEYCLOAK_AUTH_URL:http://localhost:9090/auth}
1112
auth-url: ${app.security.auth-server-url}/realms/${app.security.realm}/protocol/openid-connect/auth
1213
token-url: ${app.security.auth-server-url}/realms/${app.security.realm}/protocol/openid-connect/token
1314
refresh-token-url: ${KEYCLOAK_TOKEN_URL}
1415
corsOrigins: "*"
16+
database:
17+
host: ${DB_HOST:localhost}
18+
port: ${DB_PORT:5432}
19+
name: ${DB_NAME:multi-module-demo}
20+
username: ${DB_USER:root}
21+
password: ${DB_PASSWORD:root}
22+
swagger:
23+
clientId: ${KEYCLOAK_CLIENT_ID:swd_public_client}
24+
multipart:
25+
maxFileSize: ${MULTIPART_MAX_FILE_SIZE:50MB}
26+
maxRequestSize: ${MULTIPART_MAX_REQUEST_SIZE:51MB}
27+
retry:
28+
connectionTimeoutMillis: ${RETRY_CONNECTION_TIMEOUT_MILLI:200}
29+
readTimeoutMillis: ${RETRY_READ_TIMEOUT_MILLI:500}
30+
maxIdleConnections: ${RETRY_MAX_IDLE_CONNECTION:10}
31+
keepAliveDurationMinutes: ${RETRY_ALIVE_DURATION_MIN:5}
32+
maxRetryAttempt: ${RETRY_MAX_ATTEMPT:5}
33+
retryInterval: ${RETRY_INTERVAL_MILLI:2000}
1534

1635
server:
17-
port: ${APP_PORT:8080}
36+
port: ${app.port}
1837
shutdown: graceful
1938
servlet:
2039
contextPath: /api/app
@@ -26,7 +45,7 @@ server:
2645
springdoc:
2746
swagger-ui:
2847
oauth:
29-
clientId: ${KEYCLOAK_CLIENT_ID:swd_public_client}
48+
clientId: ${app.swagger.clientId}
3049
disable-swagger-default-url: true
3150
path: /ui/swagger-ui
3251
show-common-extensions: true
@@ -73,9 +92,9 @@ spring:
7392
database-platform: org.hibernate.dialect.PostgreSQLDialect
7493
show-sql: false
7594
datasource:
76-
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:multi-module-demo}
77-
username: ${DB_USER:admin}
78-
password: ${DB_PASSWORD:admin}
95+
url: jdbc:postgresql://${app.database.host}:${app.database.port}/${app.database.name}
96+
username: ${app.database.username}
97+
password: ${app.database.password}
7998
driverClassName: org.postgresql.Driver
8099
security:
81100
oauth2:
@@ -86,16 +105,16 @@ spring:
86105
jwk-set-uri: ${app.security.auth-server-url}/realms/${app.security.realm}/protocol/openid-connect/certs
87106
servlet:
88107
multipart:
89-
max-file-size: ${MULTIPART_MAX_FILE_SIZE:50MB}
90-
max-request-size: ${MULTIPART_MAX_REQUEST_SIZE:51MB}
108+
max-file-size: ${app.multipart.maxFileSize}
109+
max-request-size: ${app.multipart.maxRequestSize}
91110
liquibase:
92111
change-log: classpath:/db/changelog/changelog-master.xml
93112

94113
feign:
95114
default:
96-
connectionTimeoutMillis: ${RETRY_CONNECTION_TIMEOUT_MILLI:200}
97-
readTimeoutMillis: ${RETRY_READ_TIMEOUT_MILLI:500}
98-
maxIdleConnections: ${RETRY_MAX_IDLE_CONNECTION:10}
99-
keepAliveDurationMinutes: ${RETRY_ALIVE_DURATION_MIN:5}
100-
maxRetryAttempt: ${RETRY_MAX_ATTEMPT:5}
101-
retryInterval: ${RETRY_INTERVAL_MILLI:2000}
115+
connectionTimeoutMillis: ${app.retry.connectionTimeoutMillis}
116+
readTimeoutMillis: ${app.retry.readTimeoutMillis}
117+
maxIdleConnections: ${app.retry.maxIdleConnections}
118+
keepAliveDurationMinutes: ${app.retry.keepAliveDurationMinutes}
119+
maxRetryAttempt: ${app.retry.maxRetryAttempt}
120+
retryInterval: ${app.retry.retryInterval}

0 commit comments

Comments
 (0)