Fork me on GitHub

Changing the classpath scope when running Java programs

Whether you use the java goal or the special support of Java for the exec goal, you might want to change the scope of the plugin execution. This can be achieved using the classpathScope configuration element, e.g. for a test scope:

        <configuration>
          ...
          <classpathScope>test</classpathScope>
          ...
        </configuration>

or, on the command line,

mvn exec:exec [...] -Dexec.classpathScope="java"