You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Executes the supplied java class in the current VM with the enclosing project's dependencies as classpath.
44
57
*
@@ -58,6 +71,20 @@ public class ExecJavaMojo extends AbstractExecMojo {
58
71
* The main class to execute.<br>
59
72
* With Java 9 and above you can prefix it with the modulename, e.g. <code>com.greetings/com.greetings.Main</code>
60
73
* Without modulename the classpath will be used, with modulename a new modulelayer will be created.
74
+
* <p>
75
+
* Note that you can also provide a {@link Runnable} fully qualified name.
76
+
* The runnable can get constructor injections either by type if you have maven in your classpath (can be provided)
77
+
* or by name (ensure to enable {@code -parameters} Java compiler option) for loose coupling.
78
+
* Current support loose injections are:
79
+
* <ul>
80
+
* <li><code>systemProperties</code>: <code>Properties</code>, session system properties</li>
81
+
* <li><code>systemPropertiesUpdater</code>: <code>BiConsumer<String, String></code>, session system properties update callback (pass the key/value to update, null value means removal of the key)</li>
82
+
* <li><code>userProperties</code>: <code>Properties</code>, session user properties</li>
83
+
* <li><code>userPropertiesUpdater</code>: <code>BiConsumer<String, String></code>, session user properties update callback (pass the key/value to update, null value means removal of the key)</li>
* <li><code>projectPropertiesUpdater</code>: <code>BiConsumer<String, String></code>, project properties update callback (pass the key/value to update, null value means removal of the key)</li>
86
+
* <li><code>highestVersionResolver</code>: <code>Function<String, String></code>, passing a <code>groupId:artifactId</code> you get the latest resolved version from the project repositories</li>
87
+
* </ul>
61
88
*
62
89
* @since 1.0
63
90
*/
@@ -196,10 +223,11 @@ public class ExecJavaMojo extends AbstractExecMojo {
196
223
197
224
/**
198
225
* Whether to try and prohibit the called Java program from terminating the JVM (and with it the whole Maven build)
199
-
* by calling {@link System#exit(int)}. When active, a special security manager will intercept those calls. In case
200
-
* of an exit code 0 (OK), it will simply log the fact that {@link System#exit(int)} was called. Otherwise, it will
201
-
* throw a {@link SystemExitException}, failing the Maven goal as if the called Java code itself had exited with an
202
-
* exception. This way, the error is propagated without terminating the whole Maven JVM. In previous versions, users
226
+
* by calling {@link System#exit(int)}. When active, loaded classes will replace this call by a custom callback.
227
+
* In case of an exit code 0 (OK), it will simply log the fact that {@link System#exit(int)} was called.
228
+
* Otherwise, it will throw a {@link SystemExitException}, failing the Maven goal as if the called Java code itself
229
+
* had exited with an exception.
230
+
* This way, the error is propagated without terminating the whole Maven JVM. In previous versions, users
203
231
* had to use the {@code exec} instead of the {@code java} goal in such cases, which now with this option is no
204
232
* longer necessary.
205
233
*
@@ -208,6 +236,9 @@ public class ExecJavaMojo extends AbstractExecMojo {
0 commit comments