title: How to set classpath for mvn exec:exec?
body: <p>I'm trying to have <code>mvn exec:exec</code> (or <code>mvn exec:java</code>) run my program with a local jar in the classpath. However the jar fails to load:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unable to load voice directory. java.lang.ClassNotFoundException: com.sun.speech.freetts.en.us.cmu_us_slt_arctic.ArcticVoiceDirectory
  at com.sun.speech.freetts.VoiceManager.getVoiceDirectories(VoiceManager.java:211)
  at com.sun.speech.freetts.VoiceManager.getVoices(VoiceManager.java:111)
  at com.sun.speech.freetts.VoiceManager.getVoice(VoiceManager.java:521)
  at xpress.audio.TTS.&lt;init&gt;(TTS.java:66)
  at xpress.audio.TTS.&lt;init&gt;(TTS.java:62)
  at xpress.audio.AudioProducer.main(AudioProducer.java:18)
  </code></pre>
  
  <p>Running the program directly from the CLI using <code>java</code> works:</p>
  
  <pre><code>    C:\XpressAudio\target\classes&gt;java -cp "C:\XpressAudio\target\XpressAudio-1.0-SN
  APSHOT-jar-with-dependencies.jar;C:\XpressAudio\cmu_us_slt_arctic.jar;C:\XpressA
  udio\en_us.jar;C:\XpressAudio\*" xpress.audio.AudioProducer
  </code></pre>
  
  <p>Here's the <code>&lt;build&gt;</code> part of my <code>pom.xml</code>:</p>
  
  <pre><code> &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;exec&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;executable&gt;java&lt;/executable&gt;
                      &lt;mainClass&gt;xpress.audio.AudioProducer&lt;/mainClass&gt;
                  &lt;/configuration&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;cmu_us&lt;/groupId&gt;
                          &lt;artifactId&gt;slt_arctic&lt;/artifactId&gt;
                          &lt;version&gt;1.0&lt;/version&gt;
                          &lt;scope&gt;system&lt;/scope&gt;
                          &lt;systemPath&gt;${basedir}/cmu_us_slt_arctic.jar&lt;/systemPath&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p>Could someone tell me how should I edit the <code>pom.xml</code> such that <code>mvn exec:exec</code> works like the <code>java</code> command above?</p>
  
  <p><code>com.sun.speech.freetts.en.us.cmu_us_slt_arctic.ArcticVoiceDirectory</code> is a class in <code>cmu_us_slt_arctic.jar</code></p>