{test}=false or if ${maven.test.skip}=true. To do that I pulled the ant task out of pom.xml and created the enhancer.xml file which contains two targets :

"enhance" which only runs if ${test}

!=false
"enhance.all.entities" which runs if $

{maven.test.skip}

!=true.

enhance calls enhance.all.entities, which actually calls the enhancer. As I understand it you have to create multiple targets if you want to do something like this in ant - it's not really meant to be a scripting language.

Michael Dick
added a comment - 08/Feb/08 05:27 The fix I came up with is similar to the one for OPENJPA-512 .
In short the idea is to have an ant target that won't execute if $
{test}=false or if ${maven.test.skip}=true. To do that I pulled the ant task out of pom.xml and created the enhancer.xml file which contains two targets :
"enhance" which only runs if ${test}
!=false
"enhance.all.entities" which runs if $
{maven.test.skip}
!=true.
enhance calls enhance.all.entities, which actually calls the enhancer. As I understand it you have to create multiple targets if you want to do something like this in ant - it's not really meant to be a scripting language.

FTR, the build scripts attempt to run the enhancer against all entity classes except those that start with 'Unenhanced'.

This fact is probably unrelated to this JIRA issue, which was probably filed because OpenJPA should ideally not be running the enhancer at all in certain configurations. But, if you are looking for a way to store a class that should fail to enhance, then you can name it 'Unenhanced<Something>'.

Also, note that I imagine it'll be a bit tricky to decouple the enhancer in an optimal way. I believe that the -Dtest=false thing is a bit of a hack (recall that you can also do -Dtest=MyTestClassName), so probably has nothing to do with mvn build phases.

Patrick Linskey
added a comment - 18/Sep/07 15:31 FTR, the build scripts attempt to run the enhancer against all entity classes except those that start with 'Unenhanced'.
This fact is probably unrelated to this JIRA issue, which was probably filed because OpenJPA should ideally not be running the enhancer at all in certain configurations. But, if you are looking for a way to store a class that should fail to enhance, then you can name it 'Unenhanced<Something>'.
Also, note that I imagine it'll be a bit tricky to decouple the enhancer in an optimal way. I believe that the -Dtest=false thing is a bit of a hack (recall that you can also do -Dtest=MyTestClassName), so probably has nothing to do with mvn build phases.