What does this plugin do?

The jpa-maven-plugin helps make unit and integration testing of a JPA project easier.

[top]


What's so hard about JPA testing?

Nothing, if you don't mind editing your persistence.xml in your src/test/resources/META-INF directory (you do have one, right?) every time you add or delete a new entity, mapped superclass, id class or embeddable class.

[top]


Gee, that sounds like a lot of boilerplate.

It is.

[top]


Why, almost of the kind that should be generated.

That's one of the things this plugin does: generate the boilerplate list of class names in your test persistence.xml.

[top]


So kind of like an annotation processor.

Yes, but an annotation processor at compile time inspects source code. This plugin inspects classes, and inspects the classes of not only your project, but its test-time dependencies.

[top]


That's a lot of class loading; isn't this thing slow?

No, because it uses the Scannotation library to inspect the bytecode of the classes very quickly.

[top]


OK, how do I use it?

Please see the "Generating elements in a persistence.xml file example" for an example of its most common usage. More detailed information is available on the Goals page.

[top]


Does this plugin have anything to do with Hibernate?

No. This plugin is JPA-provider agnostic.

[top]


Does this plugin interact with the database?

Not as of this writing. Currently, none of this plugin's goals interact with either the database or the JPA provider.

[top]