title: How can I share class libraries with Play 2.0?
body: <p>I have some code that is common across several projects, so naturally, I'd like to have my Play web application and all of my other projects reference this code by source.</p>
  
  <p>I can't seem to figure out how this is done in Play 2.0. I've made this class library into a Maven project, installed it locally, and had the Play application reference it as a dependency, but I get a <strike>run-time</strike> compilation error where one of the shared packages isn't found. If I copy the class library .jar into my Play /lib folder, everything works as expected, but during these early stages of development, I need this to be automated.</p>
  
  <p>What's the best way to have a local class library as a dependency in Play 2.0?</p>
  
  <p>edit: My local maven repository is defined in Build.scala, as follows</p>
  
  <pre><code>    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
  
          resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository"
  
      )
  </code></pre>
  
  <p>If I run <code>play dependencies</code>, Play does indeed find my local Maven package, but I still get the compilation error (package from shared lib not found). Even if this did work though, it's still not ideal because I have to run <code>maven install</code> on my shared library every time I change it. This would be better than having to copy my .jar to all of the dependent projects, though.</p>