Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not in a position to test this, but there are two approaches I can think of. Either may work for you.</p> <p><strong>Option 1:</strong></p> <p>In one of the projects you can define the configuration for the tomcat plugin. In the snippet below there are two executions defined, both bound to the pre-integration-test phase (this might not be the best phase to do this, but it seems a good starting point as the war will have been packaged). Each execution will deploy the war defined in its configuration's warFile property.</p> <pre><code>&lt;project&gt; ... &lt;build&gt; ... &lt;plugins&gt; ... &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0-beta-1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;deploy1&lt;/id&gt; &lt;phase&gt;pre-integration-test&lt;/phase&gt; &lt;configuration&gt; &lt;warFile&gt;path/to/my/warFile1.war&lt;/warFile&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;deploy&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;deploy2&lt;/id&gt; &lt;phase&gt;pre-integration-test&lt;/phase&gt; &lt;configuration&gt; &lt;warFile&gt;path/to/my/warFile2.war&lt;/warFile&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;deploy&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; ... &lt;/plugins&gt; ... &lt;/build&gt; ... &lt;/project&gt; </code></pre> <p><strong>Option 2:</strong> This is probably the better approach. Define one execution in each war (you can omit the warFile element as the default can be used). You can then define a third project with a modules declaration referencing each war project. When the parent is built both wars will be be built and the wars deployed.</p> <p>The modules declaration for the third project:</p> <pre><code>&lt;modules&gt; &lt;module&gt;relative/path/to/war1&lt;/module&gt; &lt;module&gt;relative/path/to/war2&lt;/module&gt; &lt;modules&gt; </code></pre> <p>And the config for each war project:</p> <pre><code>&lt;project&gt; ... &lt;build&gt; ... &lt;plugins&gt; ... &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0-beta-1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;deploy&lt;/id&gt; &lt;phase&gt;pre-integration-test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;deploy&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; ... &lt;/plugins&gt; ... &lt;/build&gt; ... &lt;/project&gt; </code></pre> <hr> <p>Maven has some properties you can use to avoid absolute paths.</p> <pre><code>${maven.repo.local} will resolve to the local repository ${project.basedir} is the project directory (the root of the project) ${project.build.directory} is the build directory (default is "target") ${project.build.outputDirectory} is the directory where compilation output goes (default is "target/classes") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload