title: Execute multiple goals with parameters in maven
body: <p>I am trying to execute multiple goals in maven</p>
  
  <p>I have my Pom.xml like </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugins&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;com.lazerycode.jmeter&lt;/groupId&gt;
          &lt;artifactId&gt;jmeter-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.4.1&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;jmeter-tests&lt;/id&gt;
                  &lt;phase&gt;verify&lt;/phase&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;jmeter&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                      &lt;testFilesIncluded&gt;
                          &lt;jMeterTestFile&gt;${mytest}&lt;/jMeterTestFile&gt;                       
                      &lt;/testFilesIncluded&gt;
                      &lt;propertiesUser&gt;                
                          &lt;hostName&gt;${myhost}&lt;/hostName&gt; 
                          &lt;port&gt;${myport}&lt;/port&gt; 
                          &lt;protocol&gt;${myprotocol}&lt;/protocol&gt;              
                      &lt;/propertiesUser&gt;
                  &lt;/configuration&gt;                        
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;de.codecentric&lt;/groupId&gt;
          &lt;artifactId&gt;jmeter-graph-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;0.1.0&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;create-graphs&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;create-graph&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;phase&gt;verify&lt;/phase&gt;         
              &lt;/execution&gt;
          &lt;/executions&gt;       
      &lt;/plugin&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.4.0&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;runcommand&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;exec&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;   
          &lt;configuration&gt;
              &lt;executable&gt;mvn&lt;/executable&gt;
              &lt;arguments&gt;
                  &lt;argument&gt;**com.lazerycode.jmeter:jmeter-maven-plugin:1.4.1:jmeter@jmeter-tests -Dmyhost=hix.qa.com -Dmyport=80 -Dmyprotocol=http -Dmythreads=5 -Dmyloopcount=20 -Dmyrampup=1 -Dmytest=ScreenerAPI.jmx**&lt;/argument&gt;
                  &lt;argument&gt;de.codecentric:jmeter-graph-maven-plugin:0.1.0:create-graph@create-graphs&lt;/argument&gt;        
              &lt;/arguments&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;     
  &lt;/plugins&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have two arguments mentioned in the org.codehaus plugin.</p>
  
  <p>running the below command with argument1 disabled works fine.</p>
  
  <pre><code>mvn org.codehaus.mojo:exec-maven-plugin:1.4.0:exec@runcommand 
  </code></pre>
  
  <p>But when I run the command with both are arguments enabled gives me an error </p>
  
  <blockquote>
    <p>failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.4.1:jmeter@jmeter-tests -Dmyhost=hix.qa.com -Dmyport=80 -Dmyprotocol=http -Dmythreads=5 -Dmyloopcount=20 -Dmyrampup=1 -Dmytest=ScreenerAPI.jmx</p>
  </blockquote>
  
  <p>running goal1 and goal2 indivudally with parameters from cmd line works fine.</p>
  
  <pre><code>mvn de.codecentric:jmeter-graph-maven-plugin:0.1.0:create-graph@create-graphs 
  mvn com.lazerycode.jmeter:jmeter-maven-plugin:1.4.1:jmeter@jmeter-tests "-Dmyhost=hix.qa.com" "-Dmyport=80" "-Dmyprotocol=http" "-Dmythreads=5" "-Dmyloopcount=20" "-Dmyrampup=1" "-Dmytest=ScreenerAPI.jmx"
  </code></pre>
  
  <p>How to pass parameters to one goal from command line while running multiple goals?</p>