Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up Microsoft OpenJDK 17
uses: actions/setup-java@v4
- uses: actions/checkout@v6
- name: Set up Eclipse Temurin 25
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'microsoft'
java-version: '25'
distribution: 'temurin'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
uses: gradle/wrapper-validation-action@v3
- name: Build with Gradle
run: ./gradlew --no-daemon --parallel build -x test

Expand Down
79 changes: 41 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ allprojects {
apply plugin: 'java-library'

ext.version_options = [
SPRING_BOOT_VERSION: "3.1.5",
SPRING_VERSION : "6.0.13",
JETTY_VERSION : "9.4.44.v20210927",
MOCKITO_VERSION : "5.7.0",
JUNIT_VERSION : "5.9.3",
SPRING_BOOT_VERSION: "4.0.0",
SPRING_VERSION : "7.0.1",
JETTY_VERSION : "12.1.4",
MOCKITO_VERSION : "5.20.0",
JUNIT_VERSION : "6.0.1",
LOG4J2_VERSION : "2.25.2",
GSON_VERSION : "2.13.2",
POI_VERSION : "5.2.2",
LOG4J2_VERSION : "2.20.0",
GSON_VERSION : "2.9.0",
]

jacoco {
toolVersion = "0.8.8"
toolVersion = "0.8.14"
}

repositories {
Expand All @@ -66,20 +66,25 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'distribution'

sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.setEncoding("UTF-8")
compileTestJava.options.setEncoding("UTF-8")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

group = "${rootProject.group}"
version = "${rootProject.version}"

dependencies {
// slf4j
implementation('org.slf4j:slf4j-api:2.0.9')
implementation('org.slf4j:slf4j-api:2.0.17')
// junit 5.x and mockito
testImplementation("org.mockito:mockito-core:${version_options.MOCKITO_VERSION}")
testImplementation("org.junit.jupiter:junit-jupiter:${version_options.JUNIT_VERSION}")
testRuntimeOnly('org.junit.platform:junit-platform-launcher')
// log4j 2.x
testImplementation("org.apache.logging.log4j:log4j-api:${version_options.LOG4J2_VERSION}")
testImplementation("org.apache.logging.log4j:log4j-core:${version_options.LOG4J2_VERSION}")
Expand All @@ -93,15 +98,15 @@ subprojects {
}

distTar {
setArchivesBaseName("${project.name}")
archiveBaseName = project.name
compression = Compression.GZIP
getArchiveExtension().set('tar.gz')
archiveExtension = 'tar.gz'
}

distributions {
main {
contents {
from project.tasks.withType(Jar)
from(tasks.jar)
}
}
}
Expand All @@ -120,11 +125,11 @@ task codeCoverageReport(type: JacocoReport) {
}

reports {
xml.enabled true
xml.destination file("${buildDir}/reports/report.xml")
html.enabled false
html.destination file("${buildDir}/reports/html")
csv.enabled false
xml.required = true
xml.outputLocation = file("${buildDir}/reports/report.xml")
html.required = false
html.outputLocation = file("${buildDir}/reports/html")
csv.required = false
}

afterEvaluate {
Expand Down Expand Up @@ -169,22 +174,20 @@ Closure init_publish_module = {
}
}

model {
tasks.jar {
manifest {
attributes 'Implementation-Title': project.description ?: rootProject.description,
'Implementation-Version': project.version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion,
'Target-JDK': project.targetCompatibility
}
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenPublication }
rename ".*.xml", "pom.xml"
from generatePomPropertiesFile
}
tasks.named('jar') {
manifest {
attributes 'Implementation-Title': project.description ?: rootProject.description,
'Implementation-Version': project.version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion,
'Target-JDK': project.java.toolchain.languageVersion.map { it.asInt() }.get()
}
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenPublication }
rename ".*.xml", "pom.xml"
from generatePomPropertiesFile
}
}

Expand Down Expand Up @@ -250,7 +253,7 @@ Closure init_publish_module = {
}
maven {
name "gitea"
url = uri(project.findProperty("giteaMavenRepoUrl"))
url project.findProperty("giteaMavenRepoUrl") ?: ""
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token " + project.findProperty("giteaMavenAccessToken")
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
rl=http\://192.168.0.2/distributions/gradle-7.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
rl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions struct-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ dependencies {

implementation('mysql:mysql-connector-java:8.0.15')

implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.0")
implementation("com.sun.xml.bind:jaxb-impl:4.0.0")
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.4")
implementation("com.sun.xml.bind:jaxb-impl:4.0.6")

implementation("org.apache.logging.log4j:log4j-api:${version_options.LOG4J2_VERSION}")
implementation("org.apache.logging.log4j:log4j-core:${version_options.LOG4J2_VERSION}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.struct.spring.support.StructStoreService;
Expand Down
1 change: 1 addition & 0 deletions struct-spring-boot-starter/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
requires spring.boot.actuator;
requires spring.boot.actuator.autoconfigure;
requires spring.boot.autoconfigure;
requires spring.boot.health;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

package org.struct.spring.boot.autoconfigure;

import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.autoconfigure.contributor.CompositeHealthContributorConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.ConditionalOnEnabledHealthIndicator;
import org.springframework.context.annotation.Configuration;
import org.struct.spring.support.StructStoreService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

package org.struct.spring.boot.autoconfigure;

import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.health.contributor.AbstractHealthIndicator;
import org.springframework.boot.health.contributor.Health;
import org.struct.spring.support.StructBanner;
import org.struct.spring.support.StructStoreService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
package org.struct.spring.boot.autoconfigure;

import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.health.contributor.Health;
import org.struct.spring.support.StructStoreService;

import static org.mockito.Mockito.*;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

/**
* @author TinyZ.
Expand Down
4 changes: 2 additions & 2 deletions struct-spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies {
implementation("org.springframework:spring-core:${version_options.SPRING_VERSION}")
implementation("org.springframework:spring-oxm:${version_options.SPRING_VERSION}")

implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.0")
implementation("com.sun.xml.bind:jaxb-impl:4.0.0")
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.4")
implementation("com.sun.xml.bind:jaxb-impl:4.0.6")

testImplementation("org.springframework:spring-test:${version_options.SPRING_VERSION}")
}
Loading