1

I'm trying to use async-profiler with maven, sadly it does not track forked processes and my tests need the isolation provided by forks to run correctly.

In order to run async-profiler I need to run java with this parameter:

-agentpath:/path/to/libasyncProfiler.so=start,svg,file=profile.svg

I was thinking using surefire's argLine, but it would erase profile.svg each time. I was thinking using the project's artifactId do parameterized it, but I found no reference on that.

How can get the artifactId on the tested project in the argLine field?

Thanks by advance.

apangin
  • 92,924
  • 10
  • 193
  • 247
GlinesMome
  • 1,549
  • 1
  • 22
  • 35

1 Answers1

1

See Introduction to the POM, Project Model Variables:

Any field of the model that is a single value element can be referenced as a variable.

For your case it's ${project.artifactId}. Use this in Surefire configuration's <argLine>.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107