title: Maven exec plugin's %modulepath does not appear to work
body: <p>I am trying to run a maven project using the maven-exec-plugin and the exec goal (the java goal does not work for my purposes). However, there are two things that I need to be able to do, and I can't figure out how do both at the same time.</p>
  <p>The first is that it needs (obviously) the module path. When I set the arguments in the pom, this works, and my program does run:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
    &lt;!-- &lt;version&gt;3.0.0&lt;/version&gt; is specified in parent module's &lt;pluginManagement&gt; --&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;cli&lt;/id&gt;
        &lt;configuration&gt;
          &lt;executable&gt;java&lt;/executable&gt;
          &lt;arguments&gt;
            &lt;argument&gt;-p&lt;/argument&gt;
            &lt;modulepath/&gt;
            &lt;argument&gt;-m&lt;/argument&gt;
            &lt;argument&gt;dev.liambloom.checker.ui/dev.liambloom.checker.ui.cli.Main&lt;/argument&gt;
          &lt;/arguments&gt;
        &lt;/configuration&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  <p>However, when I do this, there is no way to pass in additional command line arguments to my program (unless I set them in the pom before every execution, which is an option, but an undesirable one).</p>
  <p>The other option, which allows me to easily add arguments, is to call exec manually or with a batch file, like this:</p>
  <pre><code>@echo off
  mvn exec:exec@cli -pl ui -Dexec.longModulepath=&quot;false&quot; -Dexec.args=&quot;-p %modulepath -m dev.liambloom.checker.ui/dev.liambloom.checker.ui.cli.Main %*&quot;
  </code></pre>
  <p>However, the <code>%modulepath</code> argument (documented <a href="https://www.mojohaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html" rel="nofollow noreferrer">here</a>), doesn't seem to be working. Here are a few lines from the detailed command output:</p>
  <pre><code>[DEBUG] Executing command line: [C:\Program Files\Java\openjdk-17\bin\java.exe, -p, %modulepath, -m, dev.liambloom.checker.ui/dev.liambloom.checker.ui.cli.Main]
  Error occurred during initialization of boot layer
  java.lang.module.FindException: Module dev.liambloom.checker.ui not found
  </code></pre>
  <p>Does anyone know how to either a.) pass arbitrary arguments in addition to the ones specified in the pom, or b.) make the <code>%modulepath</code> argument work?</p>