Add jvm args with add-opens (#145)
- when running sample apps - when running tests Closes #143
This commit is contained in:
@@ -173,6 +173,11 @@ public class JavaConventionsPlugin implements Plugin<Project> {
|
||||
testLoggingContainer.setShowStackTraces(true);
|
||||
testLoggingContainer.setExceptionFormat(TestExceptionFormat.FULL);
|
||||
});
|
||||
test.jvmArgs(
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/sun.net=ALL-UNNAMED"
|
||||
);
|
||||
project.getTasks().withType(Checkstyle.class, test::mustRunAfter);
|
||||
project.getTasks().withType(CheckFormat.class, test::mustRunAfter);
|
||||
});
|
||||
|
||||
@@ -17,6 +17,11 @@ springBoot {
|
||||
task bootRunApp1(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
|
||||
group = 'application'
|
||||
mainClass = 'app1.SpringPulsarBootApp'
|
||||
jvmArgs = [
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/sun.net=ALL-UNNAMED"
|
||||
]
|
||||
doFirst() {
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
@@ -25,6 +30,11 @@ task bootRunApp1(type: org.springframework.boot.gradle.tasks.run.BootRun, depend
|
||||
task bootRunApp2(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
|
||||
group = 'application'
|
||||
mainClass = 'app2.FailoverConsumerApp'
|
||||
jvmArgs = [
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/sun.net=ALL-UNNAMED"
|
||||
]
|
||||
doFirst() {
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user