When you are using Maven to build your project you might notice that Versant JPA has currently no direct support for Maven. Of course it is possible to build and test your project with Maven and Versant JPA. This blog post shows you some tricks to setup Versant JPA in your project.
The first step is to install Versant JPA in your local Maven Repository. For this we first create two POM files, which describe the dependencies for Versant JPA. One POM file describes the Versant JPA core, the other POM file the enhancer.
POM for Versant JPA:
POM for Bytecode Enhancer:
After that we can use this description to install Versant JPA in our Maven repository with the correct dependencies. The commands to install are below. Make sure that the paths to files are correct:
Now we can use Versant JPA in our project, like any other dependencies:
Now Versant JPA needs an enhancement step. One easy way to do that is to use the Maven Ant plugin in your project, to enhance your classes at runtime. That is where the enhancer dependency comes in handy:
In your Project's POM:
That’s it for now. With these steps you should be able to use Versant JPA in your Maven build. Make sure that you update your Maven repository with newer releases, by repeating the installation steps on each new release.