Openjpa Enhancement Support
Answered
How can I get the openjpa enhancer to run inside intellij? As part of the intellij compile?
Please sign in to leave a comment.
Hi, please try invoking it via Ant task as recommended here:
http://openjpa.apache.org/enhancement-with-ant.html
I am fully aware that I can run it manually. I am not looking for a manual solution.
I don't use ant so running it via ant is not an option.
I do use maven so I could run it manually with maven.
I do not want to run it manually. I want it to be transparent and automatic.
To this end I have been able to configure the openjpa maven plugin in intellij to run the enhance goal as part of a build (this configuation is available in the maven view).
This option has potential but it is not foolproof as it doesn't always work. When I execute the maven plugin it complains that the classes don't exist. This doesn't make sense as surely if it's configured to run after a build the classes should be there.
But I am looking for a solution that is embedded and transparent that does it automatically whenever a build in Intellij happens. So that I no longer have to worry about it.
I am afraid this feature is not supported, there were some third party plugins (for example https://github.com/hershs/enhancer) but they were not updated for a long time.
That's what I thought would be the case.
A bit late (since I just now had the same question/issue) but for future reference:
It turns out that one can easily run the OpenJPA byte-code enhancer by configuring a so called 'javaagent', using a VM switch. Assuming you 'd like to run the OpenJPA enhancer during the build of your unit tests:
When you've seen it working you probably want to make it stick for all your Unit test runs by adding this VM option to the template of your Unit test configs: