Index: trunk/pom.xml
===================================================================
--- trunk/pom.xml	(revision 19208)
+++ trunk/pom.xml	(revision 19250)
@@ -41,4 +41,6 @@
     <default-junitIT-includes>**/*TestIT.class</default-junitIT-includes>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <!-- Needed just in case something adds argLine for tests before we set it -->
+    <argLine/>
   </properties>
   <packaging>jar</packaging>
@@ -463,5 +465,6 @@
           <!-- We might need @{argLine} in the future if another plugin has issues -->
           <argLine>
-            -javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
+            @{argLine}
+            -javaagent:${org.jmockit:jmockit:jar}
             --add-opens java.base/java.io=ALL-UNNAMED
             --add-opens java.base/java.lang=ALL-UNNAMED
@@ -742,3 +745,34 @@
     </plugins>
   </build>
+  <profiles>
+    <profile>
+      <id>java-17</id>
+      <activation>
+        <jdk>[17</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- We might need @{argLine} in the future if another plugin has issues -->
+              <argLine>
+                @{argLine}
+                -javaagent:${com.ginsberg:junit5-system-exit:jar}
+                -javaagent:${org.jmockit:jmockit:jar}
+                --add-opens java.base/java.io=ALL-UNNAMED
+                --add-opens java.base/java.lang=ALL-UNNAMED
+                --add-opens java.base/java.nio=ALL-UNNAMED
+                --add-opens java.base/java.text=ALL-UNNAMED
+                --add-opens java.base/java.util=ALL-UNNAMED
+                --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
+                --add-opens java.desktop/java.awt=ALL-UNNAMED
+                --add-opens java.prefs/java.util.prefs=ALL-UNNAMED
+              </argLine>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
