Skip to content

Commit

Permalink
add jvm options to fix build in jdk16+
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Oct 5, 2021
1 parent 403e887 commit ffb6c2f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-XX:+IgnoreUnrecognizedVMOptions
--add-opens=java.base/java.util=ALL-UNNAMED
2 changes: 1 addition & 1 deletion modules/swagger-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
<version>2.22.2</version>
<configuration>
<systemPropertyVariables>
<java.security.policy>${java.security.policy}</java.security.policy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.swagger.codegen.v3.service.GenerationRequest;
import io.swagger.codegen.v3.service.Options;
import io.swagger.v3.core.util.Json;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
Expand All @@ -18,7 +17,6 @@
import org.testng.Assert;
import org.testng.annotations.Test;

import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;

Expand Down Expand Up @@ -161,7 +159,7 @@ public void testMultiTypesV2() throws Exception {

@Test
public void generateJava() throws Exception {
String json = FileUtils.readFileToString(new File("src/test/resources/petstore-oas3.json"));
String json = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("petstore-oas3.json"));
JsonNode node = Json.mapper().readTree(json);
Map<String, Object> spec = Json.mapper().convertValue(node, LinkedHashMap.class);

Expand All @@ -188,7 +186,7 @@ public void generateJava() throws Exception {
@Test
public void generateHtml() throws Exception {
HttpClient client = HttpClientBuilder.create().build();
String json = FileUtils.readFileToString(new File("src/test/resources/petstore-oas3.json"));
String json = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("petstore-oas3.json"));
JsonNode node = Json.mapper().readTree(json);
Map<String, Object> spec = Json.mapper().convertValue(node, LinkedHashMap.class);

Expand Down
5 changes: 5 additions & 0 deletions pom.docker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@
<artifactId>formatter-maven-plugin</artifactId>
<version>0.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
<argLine>-XX:+StartAttachListener</argLine>
<argLine>
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit-version}/jmockit-${jmockit-version}.jar
-XX:+IgnoreUnrecognizedVMOptions
--add-opens=java.base/java.util=ALL-UNNAMED
</argLine>
</configuration>
<executions>
Expand Down Expand Up @@ -262,6 +264,11 @@
<artifactId>formatter-maven-plugin</artifactId>
<version>0.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit ffb6c2f

Please sign in to comment.