Skip to content

CORE-9 Drop Java 8, migrate to 17 #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ jobs:
env:
JVM_OPTS: "-Xmx3200m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
CI: true
strategy:
matrix:
java: [ '8', '17' ]
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
steps:
- uses: actions/[email protected]
Expand All @@ -41,7 +40,7 @@ jobs:
java -version
./gradlew -version
- name: compile it
run: ./gradlew compileJava compileTestJava
run: ./gradlew clean assemble
- name: run tests
run: ./gradlew test
- name: Publish Test Results
Expand All @@ -52,3 +51,20 @@ jobs:
**/build/test-results/test/*.xml
**/build/test-results/**/*.trx
**/build/test-results/**/*.json


build-via-buildah:
name: Build in container
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- name: Buildah Action
uses: redhat-actions/buildah-build@v2
with:
image: my-new-image
tags: v1 ${{ github.sha }}
containerfiles: |
./zulu.Dockerfile
# build-args: |
# some_arg=some_value
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pipeline {
agent any
tools {
jdk 'jdk8'
jdk 'jdk17'
}
options {
disableConcurrentBuilds()
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ Simply run:

### Via dedicated Docker image

Run

docker run -it --rm -v $(pwd):/src dcr.ds-2.de/buildslave:0.1 ./gradlew clean build
podman build -f zulu.Dockerfile .

or

docker build -f zulu.Dockerfile .

##Layers
## Layers

DS/2 OSS Core uses a kind of layer architecture and provides some sample implementations
for each of the layers:
Expand Down
12 changes: 5 additions & 7 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ description = "DS/2 OSS Core API"
val logbackVersion: String by project

dependencies {
//compileOnly(group: 'javax.enterprise', name: 'cdi-api', version:'1.2')
//compileOnly(group: 'javax.validation', name: 'validation-api', version:'1.1.0.Final')
annotationProcessor("org.projectlombok:lombok:1.18.30")
implementation(platform("ds2.bom:jee-common:2.1.0-alpha.2"))
implementation("org.projectlombok:lombok")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
compileOnly("org.projectlombok:lombok:1.18.30")
implementation("javax.xml.bind:jaxb-api:2.3.1")
compileOnly("jakarta.platform", "jakarta.jakartaee-api", "8.0.0")
testImplementation("jakarta.platform", "jakarta.jakartaee-api", "8.0.0")
testImplementation("org.testng:testng:7.4.0")
testImplementation("org.slf4j:jul-to-slf4j:1.7.36")
testImplementation("org.testng:testng")
testImplementation("org.slf4j:jul-to-slf4j")
testRuntimeOnly("ch.qos.logback", "logback-classic", logbackVersion)
}

Expand All @@ -27,6 +25,6 @@ tasks.test {

kotlin {
jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of("8")) // "8"
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of("17"))
}
}
8 changes: 8 additions & 0 deletions api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module ds2.core.api {
requires kotlin.stdlib;
requires lombok;
requires java.xml.bind;
// requires jakarta.jakartaee.api;
exports ds2.core.api;
exports ds2.oss.core.api;
}
2 changes: 1 addition & 1 deletion base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test {
useTestNG()
maxParallelForks = 1
//maxHeapSize="1024m"
//jvmArgs '-XX:MaxPermSize=256m'
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
testLogging.showStandardStreams = true
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
ext.jacksonVersion = '2.16.0'

baseConfig {
javaVersion = JavaVersion.VERSION_1_8
javaVersion = JavaVersion.VERSION_17
//useToolchain = false
}
gitInfo() {
Expand Down
8 changes: 5 additions & 3 deletions codec-boon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ task copyTestResources(type: Copy) {
processResources.dependsOn copyResources
processTestResources.dependsOn copyTestResources, copyResources

test.dependsOn copyTestStuffToResources

test.useTestNG()
test {
useTestNG()
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
dependsOn(copyTestStuffToResources)
}
1 change: 1 addition & 0 deletions codec-fastxml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compileOnly 'jakarta.platform:jakarta.jakartaee-web-api:8.0.0'
compileOnly 'org.slf4j:slf4j-api:2.0.9'
}

Expand Down
1 change: 1 addition & 0 deletions codec-genson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compileOnly 'jakarta.platform:jakarta.jakartaee-web-api:8.0.0'
compileOnly 'org.slf4j:slf4j-api:2.0.9'
}

Expand Down
1 change: 1 addition & 0 deletions codec-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
testImplementation group: 'org.jboss', name: 'jandex', version: '3.1.5'
compileOnly(group: 'javax.enterprise', name: 'cdi-api', version: '2.0')
compileOnly 'org.slf4j:slf4j-api:2.0.9'
compileOnly 'jakarta.platform:jakarta.jakartaee-web-api:8.0.0'
}

task copyMainStuffToResources(type: Copy) {
Expand Down
1 change: 1 addition & 0 deletions crypto-bc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compileOnly 'jakarta.platform:jakarta.jakartaee-web-api:8.0.0'
}

task copyMainStuffToResources(type: Copy) {
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ include("base")
include("interceptors")
include("options")
include("crypto")
include("codec-boon")
include("codec-gson")
include("codec-fastxml")
include("webtools")
Expand All @@ -34,7 +33,6 @@ project(":base").name = "ds2-oss-core-base"
project(":interceptors").name = "ds2-oss-core-interceptors"
project(":options").name = "ds2-oss-core-options"
project(":crypto").name = "ds2-oss-core-crypto"
project(":codec-boon").name = "ds2-oss-core-codec-boon"
project(":codec-gson").name = "ds2-oss-core-codec-gson"
project(":codec-fastxml").name = "ds2-oss-core-codec-fastxml"
project(":webtools").name = "ds2-oss-core-webtools"
Expand Down
2 changes: 1 addition & 1 deletion shiro-jee/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
testImplementation project(path: ':ds2-oss-core-testutils')
testImplementation group: 'org.testng', name: 'testng', version: '7.4.0'
testImplementation 'org.slf4j:slf4j-api'
testImplementation group: 'org.jboss.weld.se', name: 'weld-se', version:'2.4.+'
testImplementation group: 'org.jboss.weld.se', name: 'weld-se-core', version:'2.4.+'
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: project.ext.logbackVersion
}

Expand Down
2 changes: 2 additions & 0 deletions statics/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module ds2.oss.core.project.ds2.oss.core.statics.main {
}
2 changes: 1 addition & 1 deletion zulu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM azul/zulu-openjdk:8
FROM docker.io/azul/zulu-openjdk:17
WORKDIR /core
COPY . .
RUN ./gradlew clean build --info --stacktrace