views:

62

answers:

1

Hi! I know I can profile my application with JProfiler using ANT target. Is there a way to do the same with maven??
Actually maven allows to run ant targets, using maven-ant plugin, but I'd like to perform such profiling without ANT.

Thanks in advance!

A: 

The JVM arguments normally used to enable profiling of the application can be added to the MAVEN_OPTS environment variable. These arguments will also be used for all applications started by Maven.

As an example my MAVEN_OPTS to enable remote debugging on a Jetty instance started by Maven:

set MAVEN_OPTS = "-Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000"
Ruben
Thanks for a quick reply Ruben! But it seems to be a bit different from what I wanted... Configuring maven in that way will force the profiler to run every time the application is run. Am I right??
Andrew
When the application is started through Maven (so not when deployed as a war, or when started from outside of Maven) it will always be possible to profile the application. This does not mean the profiler needs to be started and attached everytime.
Ruben