Showing errors when running groovy script in maven vs. running it in IDE
<p>It is a maven project. To build and run groovy script "gmavenplus" plugin is used. When I run script in maven, even when I apply the -X option, the error looks like:</p>

<pre><code>mvn -X clean install gplus:execute
</code></pre>

<blockquote>
  <p>[ERROR] Failed to execute goal
  org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute (default-cli) on
  project users_rest_updater: Error occurred while calling a method on a
  Groovy class from classpath. InvocationTargetException: No such
  property: args for class: Script1 -> [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
  execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute
  (default-cli) on project users_rest_updater: Error occurred while
  calling a method on a Groovy class from classpath.    at
  org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at
  org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at
  org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at
  org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at
  org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at
  org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at
  org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)   at
  org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)    at
  org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)  at
  org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)  at
  org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)   at
  org.apache.maven.cli.MavenCli.main(MavenCli.java:197)     at
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)     at
  org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at
  org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at
  org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at
  org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Error
  occurred while calling a method on a Groovy class from classpath.     at
  org.codehaus.gmavenplus.mojo.ExecuteMojo.doExecute(ExecuteMojo.java:128)
    at
  org.codehaus.gmavenplus.mojo.ExecuteMojo.execute(ExecuteMojo.java:83)
    at
  org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at
  org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)     at
  org.codehaus.gmavenplus.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:118)
    at
  org.codehaus.gmavenplus.mojo.ExecuteMojo.executeScripts(ExecuteMojo.java:195)
    at
  org.codehaus.gmavenplus.mojo.ExecuteMojo.doExecute(ExecuteMojo.java:124)
    ... 23 more Caused by: groovy.lang.MissingPropertyException: No such
  property: args for class: Script1     at
  org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
    at
  org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
    at
  org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
    at Script1.run(Script1.groovy:4)    at
  groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)    at
  groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)    at
  groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)</p>
</blockquote>

<p>I run the same script from IDE (Intellij IDEA), but in the console it writes exact error, in my case it is:</p>

<blockquote>
<pre><code>Caught: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
  at MainApp.run(MainApp.groovy:3)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
  ... 1 more
</code></pre>
</blockquote>

<p>current pom file:</p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;...&lt;/groupId&gt;
    &lt;artifactId&gt;...&lt;/artifactId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
            &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
            &lt;version&gt;2.4.6&lt;/version&gt;
            &lt;!--&lt;scope&gt;runtime&lt;/scope&gt;--&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;commons-cli&lt;/groupId&gt;
            &lt;artifactId&gt;commons-cli&lt;/artifactId&gt;
            &lt;version&gt;1.3.1&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax&lt;/groupId&gt;
            &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
            &lt;version&gt;7.0&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
            &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
            &lt;version&gt;3.0.16.Final&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
            &lt;artifactId&gt;resteasy-client&lt;/artifactId&gt;
            &lt;version&gt;3.0.16.Final&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
            &lt;artifactId&gt;resteasy-jaxb-provider&lt;/artifactId&gt;
            &lt;version&gt;3.0.16.Final&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
            &lt;artifactId&gt;resteasy-jackson2-provider&lt;/artifactId&gt;
            &lt;version&gt;3.0.16.Final&lt;/version&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;finalName&gt;test&lt;/finalName&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.gmavenplus&lt;/groupId&gt;
                &lt;artifactId&gt;gmavenplus-plugin&lt;/artifactId&gt;
                &lt;version&gt;1.5&lt;/version&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;addSources&lt;/goal&gt;
                            &lt;goal&gt;addTestSources&lt;/goal&gt;
                            &lt;goal&gt;compile&lt;/goal&gt;
                            &lt;goal&gt;testGenerateStubs&lt;/goal&gt;
                            &lt;goal&gt;testCompile&lt;/goal&gt;
                        &lt;/goals&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
                &lt;configuration&gt;
                    &lt;scripts&gt;
                        &lt;script&gt;file:///${project.basedir}/src/main/groovy/MainApp.groovy&lt;/script&gt;
                    &lt;/scripts&gt;
                &lt;/configuration&gt;
                &lt;dependencies&gt;
                    &lt;dependency&gt;
                        &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                        &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
                        &lt;version&gt;2.4.6&lt;/version&gt;
                        &lt;scope&gt;runtime&lt;/scope&gt;
                    &lt;/dependency&gt;
                &lt;/dependencies&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;archive&gt;
                        &lt;manifest&gt;
                            &lt;mainClass&gt;MainApp&lt;/mainClass&gt;
                        &lt;/manifest&gt;
                    &lt;/archive&gt;
                    &lt;descriptorRefs&gt;
                        &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                    &lt;/descriptorRefs&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;properties&gt;
        &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
        &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
&lt;/project&gt;
</code></pre>

<p>How can I force maven to show exact error? Without it I cannot see a way to find what's going wrong. For java code, maven always works fine. You always can see the main cause of the problem. 
Probably it is a problem of <code>gmavenplus</code> maven plugin, I'm not sure. </p>