Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Building on matt b's answer. Here's some examples of how to use the referenced plugins. Note the executions are bound to the integration-test phase to ensure the jar has been created before attempting to package it.</p> <p>The <a href="http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/" rel="nofollow noreferrer">appassembler-maven-plugin</a> will generate batch/shell files, download the dependencies (in this example to the lib directory), and place all the contents in target/appassembler</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;appassembler-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;assemble-standalone&lt;/id&gt; &lt;phase&gt;integration-test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;assemble&lt;/goal&gt; &lt;!--if you only want to create the repo and skip script generation, use this goal instead--&gt; &lt;!--goal&gt;create-repository&lt;/goal--&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;programs&gt; &lt;program&gt; &lt;mainClass&gt;name.seller.rich.Foo&lt;/mainClass&gt; &lt;name&gt;foo&lt;/name&gt; &lt;/program&gt; &lt;/programs&gt; &lt;platforms&gt; &lt;platform&gt;windows&lt;/platform&gt; &lt;platform&gt;unix&lt;/platform&gt; &lt;/platforms&gt; &lt;repositoryLayout&gt;flat&lt;/repositoryLayout&gt; &lt;repositoryName&gt;lib&lt;/repositoryName&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>The <a href="http://maven.apache.org/plugins/maven-assembly-plugin/" rel="nofollow noreferrer">assembly plugin</a> can be used to package the appassembler output into a zip:</p> <pre><code>&lt;profiles&gt; &lt;profile&gt; &lt;id&gt;archive&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;version&gt;2.2-beta-2&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;integration-test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;descriptors&gt; &lt;descriptor&gt;src/main/assembly/archive.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&gt; </code></pre> <p>And the assembly descriptor looks something like this:</p> <pre><code>&lt;assembly&gt; &lt;id&gt;archive&lt;/id&gt; &lt;formats&gt; &lt;format&gt;zip&lt;/format&gt; &lt;/formats&gt; &lt;fileSets&gt; &lt;fileSet&gt; &lt;directory&gt;${project.build.directory}/appassembler&lt;/directory&gt; &lt;outputDirectory&gt;/&lt;/outputDirectory&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;!-- add any other filesets to include docs, readmes, licences etc here --&gt; &lt;/assembly&gt; </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. 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