Note that there are some explanatory texts on larger screens.

plurals
  1. POunpack war file after maven clean package
    primarykey
    data
    text
    <p>I use maven-assembly-plugin to create a war file under [app-root]/target/my-project-war. How do I unpack this war file so it becomes a folder under application root like [app-root]/war?</p> <p>The reason I want the war folder instead of target/**.war is that I can use mvn gae:deploy to deploy directly to app engine. The gae:deploy is from maven-gae-plugin and its confirguration only allows me to specify appDir, not a war file.</p> <p>pom.xml</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;net.kindleit&lt;/groupId&gt; &lt;artifactId&gt;maven-gae-plugin&lt;/artifactId&gt; &lt;version&gt;${gae.plugin.version}&lt;/version&gt; &lt;configuration&gt; &lt;unpackVersion&gt;${gae.version}&lt;/unpackVersion&gt; &lt;serverId&gt;appengine.google.com&lt;/serverId&gt; &lt;sdkDir&gt;${gae.home}&lt;/sdkDir&gt; &lt;appDir&gt;${basedir}/war&lt;/appDir&gt; &lt;splitJars&gt;true&lt;/splitJars&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;version&gt;2.2.1&lt;/version&gt; &lt;configuration&gt; &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt; &lt;descriptors&gt; &lt;descriptor&gt;${basedir}/assembly-war.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;make-assembly&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>assembly-war.xml</p> <pre><code>&lt;assembly&gt; &lt;id&gt;war&lt;/id&gt; &lt;formats&gt; &lt;format&gt;war&lt;/format&gt; &lt;/formats&gt; &lt;includeSiteDirectory&gt;false&lt;/includeSiteDirectory&gt; &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt; &lt;fileSets&gt; ... &lt;/fileSets&gt; &lt;dependencySets&gt; &lt;/dependencySets&gt; &lt;/assembly&gt; </code></pre> <p>Here is my project folder. The War folder is in bold.</p> <pre><code>$ ls -l test-maven-play-plugin/ total 24 drwxr-xr-x 5 angeloh staff 170 Jan 25 21:45 app -rw-r--r--@ 1 angeloh staff 2962 Jan 25 23:58 assembly-war.xml drwxr-xr-x 6 angeloh staff 204 Jan 25 21:46 conf drwxr-xr-x 26 angeloh staff 884 Jan 25 22:42 lib -rw-r--r--@ 1 angeloh staff 7380 Jan 26 00:05 pom.xml drwxr-xr-x 4 angeloh staff 136 Jan 26 00:04 precompiled drwxr-xr-x 5 angeloh staff 170 Jan 25 21:45 public drwxr-xr-x 9 angeloh staff 306 Jan 26 00:04 target drwxr-xr-x 6 angeloh staff 204 Jan 25 22:11 test drwxr-xr-x 3 angeloh staff 102 Jan 25 22:15 test-result drwxr-xr-x 2 angeloh staff 68 Jan 26 00:04 tmp drwxr-xr-x 3 angeloh staff 102 Jan 25 22:10 **war** </code></pre> <p>----------------------[UPDATE]----------------------</p> <p>A little progress. If I do these changes:</p> <p>pom.xml</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; ...... &lt;configuration&gt; ...... &lt;outputDirectory&gt;${basedir}/war&lt;/outputDirectory&gt; &lt;/configuration&gt; ...... &lt;/plugin&gt; </code></pre> <p>assembly-war.xml</p> <pre><code>&lt;assembly&gt; &lt;id&gt;war&lt;/id&gt; &lt;formats&gt; &lt;format&gt;dir&lt;/format&gt; &lt;/formats&gt; ...... &lt;/assembly&gt; </code></pre> <p>The war content will output to war/test-play-1.0.0. However, I want it directly to war, not war/test-play-1.0.0.</p> <p>----------------------[UPDATE]----------------------</p> <p>Finally, after I made these changes, it works for me.</p> <p>pom.xml</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; ...... &lt;configuration&gt; ...... &lt;outputDirectory&gt;${basedir}&lt;/outputDirectory&gt; &lt;finalName&gt;war&lt;/finalName&gt; &lt;/configuration&gt; ...... &lt;/plugin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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