title: Best way to hand a WAR file from one Maven project to another, to use with Embedded Jetty?
body: <p>I thought this was simple, but having problems:</p>
  
  <ul>
  <li>Project1 is of type war.  It creates an entire webapp .war file, including some Apache modules (solr/lucene), and some of our custom code.</li>
  <li>Project2 is an existing application.  It needs to launch embedded Jetty to do queries against Project1's war file.  (see code below)</li>
  </ul>
  
  <p>Main Problem:</p>
  
  <ul>
  <li>When Project2 instantiates Jetty, it needs to pass in the full path to the WAR file, but this changes each time.  Maven adds version number stuff to Project1's war file.</li>
  </ul>
  
  <p>Assemblies to the Rescue?</p>
  
  <ul>
  <li>I'm able to get a custom assembly to work, but can't get rid of the versioning stamp from Project1.</li>
  </ul>
  
  <p>But I always wind up with Project1-1.4.1-20120530.233546-2.war.  It's in a more convenient place, but the name is still weird.</p>
  
  <p>Jetty code in Project2:</p>
  
  <pre><code>    // Context
      WebAppContext webapp = new WebAppContext();
      webapp.setContextPath("/");
      String jettyHome = System.getProperty( "jetty.home", ".." );
      String fullWarName = ...;    // Project1's WAR file. This path always changes
      webapp.setWar( fullWarName );
      // Server
      Server server = new Server( kPort ); // TODO: get from config
      server.setHandler(webapp);
      server.start();
      server.join();
  </code></pre>
  
  <p>Other considerations:</p>
  
  <ul>
  <li>I realize there is a maven-jetty plugin, but I don't believe that's appropriate here.  It seems to be targeted at Unit tests, and also our application stack doesn't use maven at runtime to launch services.</li>
  <li>I'm also aware that Solr has a fully embedded version that doesn't require a web container, but that's been deprecated for a while and not a good idea to use.</li>
  </ul>
  
  <p>Is there a better way to refactor this project?  Maybe this isn't "the maven way" ?</p>