title: How to expose JAX-RS "DTO"s from entities for REST-Clients?
body: <p>I have a Java EE 6 web application that offers it's data via a JAX-RS REST web service.
  The entities are annotated with the JPA annotations as well as with the javax.xml.bind JAX annotations.
  My aim is to assemble a client-jar out of my web-app project that contains the JAX-RS annotated "DTO" classes to be used for JAX unmarshalling in clients of my web-app.</p>
  
  <p>Putting the raw entities in the client jar is not an option because of the JPA annotations, which would lead to bogus dependencies for the client.</p>
  
  <p>Is there a way for doing this without writing the JAX-RS classes twice, for the web-app and the clients?</p>
  
  <p>I thought of annotation processing and killing all JPA annotations in the entities, that's quite techy, but not very handy.
  My second idea is to extract an interface of the needed getters/setters of the entities. The question here is how to handle the JAX annotations that are placed at the class members and at the getters.</p>
  
  <p>Both ways seem to work somehow. But is there a general purpose solution for that task?</p>
  
  <p>Hint: yes, i'm aware of the way to expose the JPA-Entities directly via rest and its coupling drawbacks to evolution etc =)</p>