mardi 19 mai 2015

Is there J2EE API as a JAR?

At first, I will mention that I am using Eclipse, but I think the question is more general: I am creating an application that uses J2EE (specifically JPA and Servlets). I would like to separate my code into two different projects (JARS): One that depends solely on the J2EE specification and one that uses some concrete implementation. Example: I want to have a JAR containing only JPA entities which only familiars with JPA API, and another that is responsible to manipulate these entities in the DB. It will depend on Hibernate concrete implementation.

My question is if there is a single JAR contains only J2EE interfaces and APIs which I can use? I would have assumed that Oracle would have released one, but I couldn't find such anywhere. Taking Eclipse for example (which assume happens the same in all IDEs because this is a Java issue), I can't compile the entities project without supplying the JPA API JAR to the compiler. Reluctantly I use the one that comes with Hibernate, but I want to completely remove the dependency with Hibernate.

Aucun commentaire:

Enregistrer un commentaire