title: how to run a plugin with jetty in maven
body: <p>I have a jetty server and I want to run a class along with the server using maven.</p>
  
  <p>The following structure is the relevant part of my project:</p>
  
  <pre class="lang-none prettyprint-override"><code>${basedir}/
    - pom.xml
    - server/
      - pom.xml
      - src/main/java/server/
        - NotificationTest.java
      - test/..
  </code></pre>
  
  <p>pom.xml in the server directory:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- ... --&gt;
  &lt;build&gt;
      &lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${jetty-maven-plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
                      &lt;httpConnector&gt;
                          &lt;port&gt;8080&lt;/port&gt;
                      &lt;/httpConnector&gt;
                      &lt;webApp&gt;
                          &lt;contextPath&gt;/test&lt;/contextPath&gt;
                      &lt;/webApp&gt;
                  &lt;/configuration&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.eclipse.jetty.http2&lt;/groupId&gt;
                          &lt;artifactId&gt;http2-server&lt;/artifactId&gt;
                          &lt;version&gt;${jetty-maven-plugin.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                          &lt;artifactId&gt;jetty-alpn-server&lt;/artifactId&gt;
                          &lt;version&gt;${jetty-maven-plugin.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>Currently, I have the following profile in the same pom.xml, in order to run the NotificationTest class:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profiles&gt;
  
      &lt;profile&gt;
          &lt;id&gt;databaseListener&lt;/id&gt;
          &lt;build&gt;
              &lt;plugins&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;${exec-maven-plugin.version}&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;java&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                      &lt;configuration&gt;
                          &lt;mainClass&gt;server.NotificationTest&lt;/mainClass&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>but in this way I need to run the two processes separately:</p>
  
  <pre><code>mvn jetty:run
  exec:java -P databaseListener
  </code></pre>
  
  <p>How can I run them both in one command?</p>