Skip to content

Commit 3741bf1

Browse files
authored
Merge pull request #60 from ie3-institute/sp/#58-java-17
Upgrading to Java 17
2 parents 61605df + a4d56be commit 3741bf1

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

Jenkinsfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
////////////////////////////////
1212

1313
/* project configuration */
14-
String javaVersionId = 'jdk-8' // id that matches the java tool with the java version that should be used set as jenkins property
14+
String javaVersionId = 'jdk-17' // id that matches the java tool with the java version that should be used set as jenkins property
1515

1616
/* git configuration */
1717
String projectName = 'simona' // name of the repository, is case insensitive
@@ -114,8 +114,7 @@ node {
114114

115115
gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest reportScoverage checkScoverage', projectName)
116116

117-
// due to an issue with openjdk-8 we use openjdk-11 for javadocs generation
118-
sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', returnStdout: true)
117+
sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc''', returnStdout: true)
119118
}
120119

121120
// sonarqube analysis
@@ -158,7 +157,7 @@ node {
158157
*/
159158
sh(
160159
script: """set +x && cd $projectName""" +
161-
''' set +x; ./gradlew javadoc -Dorg.gradle.java.home=/opt/java/openjdk''',
160+
''' set +x; ./gradlew javadoc''',
162161
returnStdout: true
163162
)
164163

@@ -388,7 +387,7 @@ def deployJavaDocs(String projectName, String sshCredentialsId, String gitChecko
388387
"git config user.name 'Johannes Hiry' && " +
389388
"git fetch --depth=1 origin api-docs && " +
390389
"git checkout api-docs && " +
391-
"cd .. && ./gradlew javadoc -Dorg.gradle.java.home=/opt/java/openjdk && " +
390+
"cd .. && ./gradlew javadoc && " +
392391
"cp -R build/docs/javadoc/* tmp-api-docs && " +
393392
"cd tmp-api-docs &&" +
394393
"git add --all && git commit -m 'updated api-docs' && git push origin api-docs:api-docs" +

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id 'signing'
88
id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined)
99
id 'pmd' // code check, working on source code
10-
id 'com.diffplug.spotless' version '6.1.0'// code format
10+
id 'com.diffplug.spotless' version '6.1.2'// code format
1111
id 'com.github.onslip.gradle-one-jar' version '1.0.6' // pack a self contained jar
1212
id "com.github.ben-manes.versions" version '0.40.0'
1313
id "de.undercouch.download" version "4.1.2" // downloads plugin
@@ -22,7 +22,7 @@ plugins {
2222

2323
ext {
2424
//version (changing these should be considered thoroughly!)
25-
javaVersion = JavaVersion.VERSION_1_8
25+
javaVersion = JavaVersion.VERSION_17
2626

2727
scalaVersion = '2.13'
2828
scalaBinaryVersion = '2.13.7'
@@ -92,7 +92,7 @@ dependencies {
9292
implementation "ch.qos.logback:logback-classic:1.2.10"
9393

9494
/* testing */
95-
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
95+
testImplementation 'org.spockframework:spock-core:2.1-M2-groovy-3.0'
9696
testImplementation 'org.scalatestplus:mockito-3-4_2.13:3.2.9.0'
9797
implementation 'org.mockito:mockito-core:4.2.0' // mocking framework
9898
testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.10"

gradle.properties

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx4096m
12+
13+
# Workaround to make spotless work with java 17 -
14+
# see https://github.com/diffplug/spotless/tree/main/plugin-gradle#google-java-format and
15+
# https://github.com/ie3-institute/simona/issues/59 for details
16+
org.gradle.jvmargs=-Xmx4096m \
17+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
18+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
19+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
20+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
21+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
1322

1423
# When configured, Gradle will run in incubating parallel mode.
1524
# This option should only be used with decoupled projects. More details, visit

src/test/groovy/edu/ie3/simona/model/participant/PVModelTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class PVModelTest extends Specification {
317317
where: "the following parameters are given"
318318
latitudeInDeg | deltaIn | omegaIn || alphaSOut
319319
43d | -14d | -37.5d || 23.4529893659531784299686037109330117049955654837550 // '2011-02-13T09:30:00'
320-
43d | 23.1d | 97.5d || 10.3561513175064165807300181176479988436754378357928 // '2011-07-01T06:30:00'
320+
43d | 23.1d | 97.5d || 10.356151317506402829742934977890382350725031728508 // '2011-07-01T06:30:00'
321321
}
322322
323323
def "Calculate Rb (cos(thetaG)/cos(thetaZ))"() {
@@ -349,8 +349,8 @@ class PVModelTest extends Specification {
349349
45 | -7.15 | -82.5 | 0 | 0 || 89.795654742951077439582101317248278436936658210074 // thetaZ
350350
40 | -11.6 | -82.5 | 60 | 0 || 79.110119287443572813858647674599902596082559960114
351351
40 | -11.6 | 82.5 | 60 | 0 || 79.110119287443572813858647674599902596082559960114
352-
40 | -11.6 | -78.0 | 60 | 0 || 74.9207206518514467357682971033566198212518156744
353-
40 | -11.6 | 78.0 | 60 | 0 || 74.9207206518514467357682971033566198212518156744
352+
40 | -11.6 | -78.0 | 60 | 0 || 74.920720651851429547034443178659599205063808040294
353+
40 | -11.6 | 78.0 | 60 | 0 || 74.920720651851429547034443178659599205063808040294
354354
}
355355
356356
def "Calculate the estimate beam radiation eBeamS"() {

0 commit comments

Comments
 (0)