title: ClassNotFoundException when running clojure jar
body: <p>I am trying to run a clojure jar file and I get the error below:</p>
  
  <pre><code>C:\Users\Nahashon&gt;java -jar C:\Users\Nahashon\.m2\repository\org\enclojure\sample\0.0.1\sample-0.0.1.jar
  Exception in thread "main" java.lang.NoClassDefFoundError: com/mode/mdzw
  
  Caused by: java.lang.ClassNotFoundException: com.mode.mdzw
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
  Could not find the main class: com.mode.mdzw. Program will exit.
  </code></pre>
  
  <p>The clojure project is created using maven on netbeans 6.9.1. and the clojure code is as below:</p>
  
  <pre><code>(ns com.mode.mdzw
  (:gen-class))
  
  (defn -main []
  (println "Looks like it works!"))
  </code></pre>
  
  <p>The POM file is as below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/maven-v4_0_0.xsd"&gt;
  &lt;properties&gt;
      &lt;clojure.version&gt;1.1.0&lt;/clojure.version&gt;
  &lt;/properties&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.enclojure&lt;/groupId&gt;
  &lt;artifactId&gt;sample&lt;/artifactId&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;name&gt;mdzw&lt;/name&gt;
  &lt;description&gt;mdzw&lt;/description&gt;
  &lt;build&gt;
   &lt;sourceDirectory&gt;src/main/clojure&lt;/sourceDirectory&gt;
   &lt;testSourceDirectory&gt;src/test/clojure&lt;/testSourceDirectory&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/clojure&lt;/directory&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;testResources&gt;
          &lt;testResource&gt;
              &lt;directory&gt;src/test/clojure&lt;/directory&gt;
          &lt;/testResource&gt;
      &lt;/testResources&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;com.theoryinpractise&lt;/groupId&gt;
      &lt;artifactId&gt;clojure-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.3.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;sourceDirectories&gt;
              &lt;sourceDirectory&gt;src/main/clojure&lt;/sourceDirectory&gt;
          &lt;/sourceDirectories&gt;
          &lt;clojureOptions&gt;-Xmx1G&lt;/clojureOptions&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;compile-clojure&lt;/id&gt;
          &lt;phase&gt;compile&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;compile&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
        &lt;source&gt;1.5&lt;/source&gt;
        &lt;target&gt;1.5&lt;/target&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  
    &lt;!-- --&gt;
     &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
              &lt;archive&gt;
                  &lt;manifest&gt;
                      &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                      &lt;mainClass&gt;classes.com.mode.mdzw&lt;/mainClass&gt;
                      &lt;classpathPrefix&gt;dependency&lt;/classpathPrefix&gt;
                  &lt;/manifest&gt;
              &lt;/archive&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;copy-dependencies&lt;/id&gt;
                  &lt;phase&gt;package&lt;/phase&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
  
  &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;repositories&gt;
    &lt;repository&gt;
    &lt;id&gt;central&lt;/id&gt;
    &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
    &lt;/repository&gt;
  &lt;repository&gt;
    &lt;id&gt;clojure-releases&lt;/id&gt;
    &lt;url&gt;http://build.clojure.org/releases&lt;/url&gt;
  &lt;/repository&gt;
  &lt;repository&gt;
    &lt;id&gt;incanter&lt;/id&gt;
    &lt;url&gt;http://repo.incanter.org&lt;/url&gt;
  &lt;/repository&gt;
  &lt;repository&gt;
    &lt;id&gt;clojure-snapshots&lt;/id&gt;
    &lt;url&gt;http://build.clojure.org/snapshots&lt;/url&gt;
  &lt;/repository&gt;
  &lt;repository&gt;
    &lt;id&gt;clojars&lt;/id&gt;
    &lt;url&gt;http://clojars.org/repo/&lt;/url&gt;
  &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;dependencies&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.clojure&lt;/groupId&gt;
     &lt;artifactId&gt;clojure&lt;/artifactId&gt;
     &lt;version&gt;${clojure.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.clojure&lt;/groupId&gt;
     &lt;artifactId&gt;clojure-contrib&lt;/artifactId&gt;
     &lt;version&gt;${clojure.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;swank-clojure&lt;/groupId&gt;
     &lt;artifactId&gt;swank-clojure&lt;/artifactId&gt;
     &lt;version&gt;1.1.0-SNAPSHOT&lt;/version&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.clojure&lt;/groupId&gt;
          &lt;artifactId&gt;clojure&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.clojure&lt;/groupId&gt;
          &lt;artifactId&gt;clojure-contrib&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
     &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>What am I not doing right?</p>