简体   繁体   中英

Profiling maven web application with JProfiler

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!

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"

It is driven by JVM arguments and some environment entry. See http://resources.ej-technologies.com/jprofiler/help/doc/ for more details at "Requirements for remote profiling" chapter. There is the remote application profiling wizard, and it also tells you what to do exactly. You should do the following:

1.4 JVM LINUX: LD_LIBRARY_PATH environment variable should contain profiler/bin

1.4 JVM Windows: PATH environment variable should contain profiler/bin

1.4 Both: Add -Xrunjprofiler -Xbootclasspath/a:{path to agent.jar} JVM arguments

Above 1.5: -agentpath:[path to jprofilerti library] should be added to JVM arguments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM