The Invoking Methods told us as the following: -
Reflection provides a means for invoking methods on a class. Typically, this would only be necessary if it is not possible to cast an instance of the class to the desired type in non-reflective code.
Methods are invoked with
java.lang.reflect.Method.invoke()
. The first argument isthe object instance
on which this particular method is to be invoked. (If the method is static, the first argument should be null.) Subsequent arguments are themethod's parameters
.If the underlying method throws an exception, it will be wrapped by an
java.lang.reflect.InvocationTargetException
. The method's original exception may be retrieved using the exception chaining mechanism'sInvocationTargetException.getCause()
method.
Since the stacktrace also told us that the exec:java
also uses the Reflection
as well. Then the original exception is also wrapped as well. Please refer to the source code of at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) for further reference.
I hope this may help.