From 0431e9e605d4de0c39e2784e7cf95568ae418228 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Thu, 9 Jun 2022 14:38:45 +0200
Subject: [PATCH] uniform way of providing java-17 options to surefire

---
 .gitlab-ci.yml | 5 ++---
 pom.xml        | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8298106800..3cb81ff223 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -56,7 +56,6 @@ test:frontend:
   coverage: '/(\d+.\d+) \% covered/'
   before_script:
     # java.desktop module does not export Sun Graphics implementation for mockito
-    - export MAVEN_ARGS=-DsurefireArgLine=--add-opens=java.desktop/sun.java2d=ALL-UNNAMED
     - apt-get update
     - DEBIAN_FRONTEND=noninteractive apt-get install -y libxrender1 libxtst6 fontconfig libfreetype6
     - mvn dependency:purge-local-repository -DmanualInclude="lcsb.mapviewer"
@@ -80,7 +79,7 @@ test:frontend:
     - export DISPLAY=:99
 
     - mvn -DskipTests=true clean install -pl commons -am
-    - mvn test -pl commons $MAVEN_ARGS
+    - mvn test -pl commons 
     - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions,"% covered" }' commons/target/site/jacoco/jacoco.csv
 
 .test_backend_annotation_template:
@@ -111,7 +110,7 @@ test:frontend:
 .test_backend_converter_graphics_template:
   script: &test_backend_converter_graphics_definition
     - mvn -DskipTests=true clean install -pl converter-graphics -am
-    - mvn test -pl converter-graphics  $MAVEN_ARGS
+    - mvn test -pl converter-graphics
     - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions,"% covered" }' converter-graphics/target/site/jacoco/jacoco.csv
 
 .test_backend_converter_CellDesigner_template:
diff --git a/pom.xml b/pom.xml
index 37c564ae93..6e983fa85e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -214,7 +214,7 @@
 				<configuration>
 					<useSystemClassLoader>false</useSystemClassLoader>
 					<surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
-					<argLine>@{argLine} ${surefireArgLine}</argLine>
+					<argLine>@{argLine} ${surefireArgLine} --add-opens=java.desktop/sun.java2d=ALL-UNNAMED -XX:+IgnoreUnrecognizedVMOptions</argLine>
 				</configuration>
 			</plugin>
 			<plugin>
-- 
GitLab