title: Sharing classes between Android application and Jersey server application
body: <p>I'm building an Android application that will talk to a web service built in Java and Jersey.</p>
  
  <p>I've currently organized three projects:</p>
  
  <ul>
  <li>core (common) is a simple set of POJOs for my domain models</li>
  <li>client (android) is the Android application</li>
  <li>server (jersey) is a Jersey application storing data in MongoDB and relying on the Morphia library for persistence.</li>
  </ul>
  
  <p>The core library is a project dependency for each of the other two.</p>
  
  <p>The problem is that I've created my set of entity classes in "core", but those classes are configured for Morphia using annotations.
  This means Morphia in turn becomes a dependency on my Android application, which I don't particularly like.</p>
  
  <p>Ideally, Morphia would allow configuration via flat files but it only supports configuring entity classes via annotations.</p>
  
  <p>Should I suck up the ugly dependency of 'core' relying on Morphia, or is there a better way to organize my classes that I'm not thinking of?</p>
  
  <p><em>Note:</em> I have tried removing the Morphia annotations from the core classes, and created new classes in the "server" project that inherit the "core" classes and add the Morphia annotations. However, if my Jersey application returns classes from the server project, then the Android client can't use those classes with the Jersey client.</p>
  
  <p>Thanks</p>