title: Specify javaagent argument with Maven exec plugin
body: <p>I have a similar question to: <a href="https://stackoverflow.com/questions/1020731/java-agents-with-maven-in-eclipse">this previous question</a></p>
  
  <p>I am converting a Java project using Netbeans to Maven. In order to launch the program, one of the command-line arguments we need is the -javaagent setting. e.g.</p>
  
  <pre><code>-javaagent:lib/eclipselink.jar
  </code></pre>
  
  <p>I'm trying to get Netbeans to launch the application for development use (we will write custom launch scripts for final deployment) </p>
  
  <p>Since I'm using Maven to manage the Eclipselink dependencies, I may not know the exact filename of the Eclipselink jar file. It may be something like eclipselink-2.1.1.jar based on the version I have configured in the pom.xml file.</p>
  
  <p>How do I configure the exec-maven-plugin to pass the exact eclipselink filename to the command line argument? </p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
         &lt;executable&gt;java&lt;/executable&gt;
             &lt;arguments&gt;
                 &lt;argument&gt;-Xmx1000m&lt;/argument&gt;
                 &lt;argument&gt;-javaagent:lib/eclipselink.jar&lt;/argument&gt; &lt;==== HELP?
                 &lt;argument&gt;-classpath&lt;/argument&gt;
                 &lt;classpath/&gt;
                 &lt;argument&gt;my.App&lt;/argument&gt;
             &lt;/arguments&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>