Openjpa Enhancement Support

Answered

How can I get the openjpa enhancer to run inside intellij? As part of the intellij compile?

0
5 comments

Hi, please try invoking it via Ant task as recommended here:

http://openjpa.apache.org/enhancement-with-ant.html

0
Avatar
Permanently deleted user

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.

 

 

1

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.

0
Avatar
Permanently deleted user

That's what I thought would be the case. 

 
I'm evaluating intellij because I'm getting tired of devving on eclipse as they haven't improved the basic java ide at all for a while but I'm not sure I'm willing to pay for an ide that I have to enhance my persistent classes manually. 
 
Is it possible to still do this via plugin? It it even possible to write a plugin for this? Does intellij support this?
 
Can one sell plugins? Because I'm rather reluctant to spend time working on a plugin when I've already shelled out money to use the base ide.
 
 
 
0

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:

  • Open 'Run/Debug Configurations' (menu Run | Edit Configurations...)
  • Add or open the run-config you want to kick-off the OpenJPA byte-code enhancement
  • Add a VM option: '-javaagent:<path_to_jpa_lib>/openjpa-<version>.jar'

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:

2

Please sign in to leave a comment.