Hello,

I'm starting to lose hope in this ... I got my class library using OpenJPA
to work nicely in Netbeans using Ant support and storing stuff in the
backend Derby database.
Then I decided to move to the much newer Gradle and - after a bit of a
learning curve - all builds work find. The one thing that doesn't work is
the weaving
of OpenJPA which requires -javaagent:<openJPA>/openjpa-3.1.0.jar on the
command line. I am not able to figure out how to get this into the
execution
path of Gradle within Netbeans. It always fails with not getting the
-javaagent argument passed to the JVM from within NB. I can try the Run
button in the menu bar or
right-click "run <main class>", same problem. OpenJPA doesn't work because
the weaving is not possible ... the Java Agent is missing.

I have tried the build config in Netbeans under Project - Properties -
Build - BuildActions with run and run.single, no luck - I can not find the
right syntax for JVM arguments.
Either they're ignored or I get an error message.

I have tried modifying the local gradlew script by injecting the argument
in the command string, but when I run it from the command line, it finds
the Java Agent (Open JPA weaver)
but still fails because the classpath is not set correctly, all dependent
libs are missing. When I run it from within NB, it ignores any changes to
my local gradlew (which is confusing in itself).

This is honestly driving me nuts ... I got it to run nicely in IntelliJ
with their concept of "Run configurations" which allows for direct
specification of JVM parameters. NB doesn't
seem to have such a concept.

How can I pass a -javaagent argument to a gradle task (run, runSingle)
started within NB?

Any help greatly appreciated ... before I go back to Ant and stop wasting
more time :-(

Thx Matthias

Reply via email to