title: Maven build for machine learning - how do I get it working?
body: <p>I'm trying to compile and run some basic Java code in this repository:
  <a href="https://github.com/jasebell/mlbookexamples" rel="nofollow">https://github.com/jasebell/mlbookexamples</a></p>
  
  <p>As an example, inside the Java folder, chapter2.BritneyDilemma.</p>
  
  <p>I'm trying to do this with maven (as there's a pom.xml) but I feel that there's a few things holding me back. I don't know much about Maven; my background is C and cmake. At first glance, I can see why people hate Maven. The pom.xml for the project doesn't seem fully configured / appears quite non-standard:</p>
  
  <ul>
  <li>It only pulls down some dependencies, for example BritneyDilemma requires classifier4J but this isn't mentioned in the pom.xml.</li>
  <li>When I do any of the simple commands mvn install/compile etc, the output into target is basically nothing (it's an almost empty jar).</li>
  </ul>
  
  <p>I've tried various approaches such as:</p>
  
  <ul>
  <li>Modifying the pom.xml to add in the <a href="http://maven.apache.org/plugins/maven-assembly-plugin/usage.html" rel="nofollow">maven assembly plugin</a> and running a <code>mvn clean compile package</code>. At most I managed to get a jar that packaged the pom.xml dependencies, but still couldn't compile BritneyDilemma due to not having classifier4j (this isn't mentioned in the pom.xml so I'm unsure how maven is supposed to know it's a requirement/where to pull it from).</li>
  <li>Moving away from maven, downloading classifer4j and compiling via the command line. Run time error and a bit of sleuthing pointed out I was missing some <a href="http://sourceforge.net/p/classifier4j/mailman/classifier4j-devel/?viewmonth=200411" rel="nofollow">classifier4j dependency</a>, I assume this was because I moved away from maven and this would otherwise have been taken care of by some recursive building.</li>
  </ul>
  
  <p>Here is a stock build attempt, making no modifications/taking the pom.xml as is:</p>
  
  <pre><code>~/projects/mlbookexamples/java (master) $ mvn install
  [INFO] Scanning for projects...
  [INFO] ------------------------------------------------------------------------
  [INFO] Building mlbook
  [INFO]    task-segment: [install]
  [INFO] ------------------------------------------------------------------------
  [INFO] [resources:resources {execution: default-resources}]
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory /home/alex/projects/mlbookexamples/java/src/main/resources
  Downloading: http://repo.springsource.org/libs-milestone//javax/batch/javax.batch-api/1.0/javax.batch-api-1.0.jar
  34K downloaded  (javax.batch-api-1.0.jar)
  [INFO] [compiler:compile {execution: default-compile}]
  [INFO] No sources to compile
  [INFO] [resources:testResources {execution: default-testResources}]
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory /home/alex/projects/mlbookexamples/java/src/test/resources
  [INFO] [compiler:testCompile {execution: default-testCompile}]
  [INFO] No sources to compile
  [INFO] [surefire:test {execution: default-test}]
  [INFO] No tests to run.
  [INFO] Surefire report directory: /home/alex/projects/mlbookexamples/java/target/surefire-reports
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO] [jar:jar {execution: default-jar}]
  [WARNING] JAR will be empty - no content was marked for inclusion!
  [INFO] Building jar: /home/alex/projects/mlbookexamples/java/target/mlbookexamples-1.0-SNAPSHOT.jar
  [INFO] [install:install {execution: default-install}]
  [INFO] Installing /home/alex/projects/mlbookexamples/java/target/mlbookexamples-1.0-SNAPSHOT.jar to /home/alex/.m2/repository/com/datasentiment/mlbook/mlbookexamples/1.0-SNAPSHOT/mlbookexamples-1.0-SNAPSHOT.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESSFUL
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6 seconds
  [INFO] Finished at: Wed Mar 04 08:38:56 NZDT 2015
  [INFO] Final Memory: 33M/249M
  [INFO] ------------------------------------------------------------------------
  ~/projects/mlbookexamples/java/target (master) $ java -jar mlbookexamples-1.0-SNAPSHOT.jar 
  no main manifest attribute, in mlbookexamples-1.0-SNAPSHOT.jar
  </code></pre>
  
  <p>I'm running arch linux.</p>