Skip to content

Commit 389d40b

Browse files
authored
[#11239] Update Java requirement to Java 11 (#11321)
* Update Java requirement to Java 11 * Update Gradle to 7.1.1
1 parent d03f531 commit 389d40b

File tree

10 files changed

+32
-60
lines changed

10 files changed

+32
-60
lines changed

.github/workflows/component.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
steps:
2222
- uses: actions/checkout@v2
23-
- name: Set up JDK 1.8
23+
- name: Set up JDK 11
2424
uses: actions/setup-java@v1
2525
with:
26-
java-version: 1.8
26+
java-version: 11
2727
- name: Cache Gradle packages
2828
uses: actions/cache@v2
2929
with:
@@ -47,10 +47,10 @@ jobs:
4747
runs-on: ${{ matrix.os }}
4848
steps:
4949
- uses: actions/checkout@v2
50-
- name: Set up JDK 1.8
50+
- name: Set up JDK 11
5151
uses: actions/setup-java@v1
5252
with:
53-
java-version: 1.8
53+
java-version: 11
5454
- name: Cache Gradle packages
5555
uses: actions/cache@v2
5656
with:

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
browser: [firefox]
2121
steps:
2222
- uses: actions/checkout@v2
23-
- name: Set up JDK 1.8
23+
- name: Set up JDK 11
2424
uses: actions/setup-java@v1
2525
with:
26-
java-version: 1.8
26+
java-version: 11
2727
- name: Cache Gradle packages
2828
uses: actions/cache@v2
2929
with:

.github/workflows/lnp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Set up JDK 1.8
15+
- name: Set up JDK 11
1616
uses: actions/setup-java@v1
1717
with:
18-
java-version: 1.8
18+
java-version: 11
1919
- name: Cache Gradle packages
2020
uses: actions/cache@v2
2121
with:

build.gradle

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def jacocoVersion = "0.8.5"
1414

1515
buildscript {
1616
repositories {
17-
jcenter()
17+
mavenCentral()
1818
maven {
1919
url "https://plugins.gradle.org/m2/"
2020
}
@@ -34,11 +34,11 @@ configurations {
3434
}
3535

3636
repositories {
37-
jcenter()
37+
mavenCentral()
3838
}
3939

4040
def objectify = "com.googlecode.objectify:objectify:6.0.7"
41-
def testng = "org.testng:testng:7.2.0"
41+
def testng = "org.testng:testng:7.4.0"
4242

4343
dependencies {
4444
staticAnalysis("com.puppycrawl.tools:checkstyle:${checkstyleVersion}")
@@ -258,14 +258,14 @@ task copyDistToExplodedWar {
258258

259259
task serverRun(type: JavaExec) {
260260
classpath "${explodeWar.destinationDir}/WEB-INF/lib/*", "${explodeWar.destinationDir}/WEB-INF/classes/."
261-
main = "teammates.main.Application"
261+
mainClass = "teammates.main.Application"
262262
jvmArgs "-ea", "-Djava.util.logging.config.file=${explodeWar.destinationDir}/WEB-INF/logging-dev.properties"
263263
dependsOn explodeWar, copyDistToExplodedWar
264264
}
265265

266266
task runDatastoreEmulator(type: JavaExec) {
267267
classpath = sourceSets.main.runtimeClasspath
268-
main = "teammates.storage.api.DatastoreEmulatorRunner"
268+
mainClass = "teammates.storage.api.DatastoreEmulatorRunner"
269269
}
270270

271271
appengine {
@@ -442,8 +442,8 @@ task architectureTest(type: Test) {
442442
options.useDefaultListeners = true
443443
ignoreFailures false
444444
maxHeapSize = "1g"
445-
reports.html.enabled = false
446-
reports.junitXml.enabled = false
445+
reports.html.required = false
446+
reports.junitXml.required = false
447447
jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8"
448448
afterTest afterTestClosure
449449
afterSuite checkTestNgFailureClosure
@@ -472,8 +472,8 @@ task lnpTests(type: Test) {
472472
options.useDefaultListeners = true
473473
ignoreFailures false
474474
maxHeapSize = "1g"
475-
reports.html.enabled = false
476-
reports.junitXml.enabled = false
475+
reports.html.required = false
476+
reports.junitXml.required = false
477477
jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8"
478478
afterTest afterTestClosure
479479
afterSuite checkTestNgFailureClosure
@@ -503,8 +503,8 @@ task componentTests(type: Test) {
503503
options.useDefaultListeners = true
504504
ignoreFailures false
505505
maxHeapSize = "1g"
506-
reports.html.enabled = false
507-
reports.junitXml.enabled = false
506+
reports.html.required = false
507+
reports.junitXml.required = false
508508
jvmArgs "-ea", "-Xss2m", "-Dfile.encoding=UTF-8"
509509
afterTest afterTestClosure
510510
afterSuite checkTestNgFailureClosure
@@ -529,8 +529,8 @@ task e2eTests {
529529
options.useDefaultListeners = true
530530
ignoreFailures = !isLastRetry
531531
maxHeapSize = "1g"
532-
reports.html.enabled = false
533-
reports.junitXml.enabled = false
532+
reports.html.required = false
533+
reports.junitXml.required = false
534534
jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8"
535535
testLogging {
536536
events "passed"
@@ -559,25 +559,12 @@ task jacocoReport(type: JacocoReport) {
559559
classDirectories.from files(sourceSets.main.output)
560560
executionData fileTree("${buildDir}/jacoco").files
561561
reports {
562-
xml.enabled true
563-
html.enabled true
562+
xml.required = true
563+
html.required = true
564564
}
565565
afterEvaluate {
566566
classDirectories.from files(classDirectories.files.collect {
567567
fileTree(dir: it, exclude: ["**/*.jar"])
568568
})
569569
}
570570
}
571-
572-
// Helper methods
573-
import groovy.xml.StreamingMarkupBuilder
574-
import java.nio.charset.StandardCharsets
575-
576-
void writeXmlToPath(Node xml, String pathToWrite) {
577-
new File(pathToWrite).withWriter(StandardCharsets.UTF_8.name()) { out ->
578-
out << new StreamingMarkupBuilder().bind { mkp.xmlDeclaration() }
579-
def xmlNodePrinter = new XmlNodePrinter(new PrintWriter(out))
580-
xmlNodePrinter.preserveWhitespace = true
581-
xmlNodePrinter.print(xml)
582-
}
583-
}

docs/setting-up.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ More information can be found at [this documentation](https://help.github.com/ar
4040

4141
These tools are necessary regardless of whether you are developing front-end or back-end:
4242

43-
1. Install JDK 1.8.
43+
1. Install Java JDK 11.
4444
1. Install Python 3 (recommended) or Python 2.7.
4545

4646
If you want to develop front-end, you need to install the following:

gradle.template.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ org.gradle.daemon=false
44

55
# Use this property if you want to use a JDK other than the one specified in your PATH variable.
66
# Windows users should use a forward slash (/) instead of the Windows default backward slash (\) while specifying the path.
7-
# e.g org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
8-
# e.g org.gradle.java.home=C:/Program Files/Java/jdk1.8.0_202
7+
# e.g org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
8+
# e.g org.gradle.java.home=C:/Program Files/Java/jdk-11
99
# org.gradle.java.home=
1010

1111
# Use this property if you want to use a specific Cloud SDK installation.

gradle/wrapper/gradle-wrapper.jar

626 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ case "`uname`" in
7272
Darwin* )
7373
darwin=true
7474
;;
75-
MINGW* )
75+
MSYS* | MINGW* )
7676
msys=true
7777
;;
7878
NONSTOP* )
@@ -130,7 +130,7 @@ fi
130130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133-
133+
134134
JAVACMD=`cygpath --unix "$JAVACMD"`
135135

136136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,29 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

8772

8873
@rem Execute Gradle
89-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
9075

9176
:end
9277
@rem End local scope for the variables with windows NT shell

0 commit comments

Comments
 (0)