It is often better to enhance your entities at build times and it generally simply needs to add -Aopenjpa.metamodel=true to maven compiler compilerArguments and openjpa to the classpath of the plugin but it has two main drawbacks:
- if you need to use other processors you can’t manage it correctly
- it simply doesn’t work with maven compiler plugin 3.0
Of course there is an interesting alternative.
Sometimes it can be useful to deploy a JCA connector in a war.
That’s why TomEE got some features related to this need.
Arquillian is great but when testing always on the same app, in a single thread in embedded mode it is a pain to deploy the app for each class.
You can create your own extension as shown by Aslask (https://gist.github.com/3975179) but you need to code it.
If you need the arquillian features that’s probably the best way to go but if you just want to deploy the app OpenEJB has a hack too (probably easier).
TomEE maven plugin offers you a way to update file from your maven project to the deployed application. It offers a way to reload the deployed application if a file is updated in the configured update interval. That’s fine but on real projects you want to reload it only if it is a class and not a simple resource (css, js…).
That’s why some more features were added for next version (1.5.2).
Until TomEE 1.5.1 JAXRS deployment policy was to map a servlet by endpoint.
This had two drawbacks:
- you had to put @Path at class level for all JAXRS classes
- The entry point for a request was the servlet router (Tomcat) and not the JAXRS one so the routing wasn’t as fine as possible with JAXRS
The advantage was each endpoint were configurable separately.
OpenJPA, as a lot of JPA providers, supports some custom configuration through specific annotations. That’s great but it makes your code not portable.
It is often not known but OpenJPA comes with the ability to replace these annotations (at least a lot of these annotations) by a simple XML configuration.