Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We use profiles to distinguish between the different build phases, and we use the assembly plugin with different assembly descriptors for each profile. We have something like the code below. Our default profile is development, but when we release the "release" profile is activated automatically. The assembly descriptors are pretty simple and we have one "common" directory structure, one for development, and one for release.</p> <pre><code> &lt;build&gt; &lt;plugins&gt; &lt;!-- Enable Java 6 features. --&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;source&gt;6&lt;/source&gt; &lt;target&gt;6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;!-- Configure for development environment. --&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;package&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;assembly&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;descriptors&gt; &lt;descriptor&gt;src/main/assembly/dist-dev.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;!-- Deployment configuration. --&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;groupId&gt;${project.groupId}&lt;/groupId&gt; &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;packaging&gt;zip&lt;/packaging&gt; &lt;file&gt;target/${project.build.finalName}.zip&lt;/file&gt; &lt;url&gt;${project.distributionManagement.snapshotRepository.url}&lt;/url&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;!-- Release configuration. --&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;goals&gt;assembly:assembly deploy:deploy-file&lt;/goals&gt; &lt;useReleaseProfile&gt;false&lt;/useReleaseProfile&gt; &lt;arguments&gt;-Prelease&lt;/arguments&gt; &lt;/configuration&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.maven.scm&lt;/groupId&gt; &lt;artifactId&gt;maven-scm-api&lt;/artifactId&gt; &lt;version&gt;1.4&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.maven.scm&lt;/groupId&gt; &lt;artifactId&gt;maven-scm-provider-bazaar&lt;/artifactId&gt; &lt;version&gt;1.4&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;profiles&gt; &lt;!-- Release profile. --&gt; &lt;profile&gt; &lt;id&gt;release&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;!-- Artifact to deploy is assembled zip file. --&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;groupId&gt;${project.groupId}&lt;/groupId&gt; &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;packaging&gt;zip&lt;/packaging&gt; &lt;file&gt;target/${project.build.finalName}-bin.zip&lt;/file&gt; &lt;url&gt;${project.distributionManagement.repository.url}&lt;/url&gt; &lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;!-- Configure for release environment. --&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;descriptors&gt; &lt;descriptor&gt;src/main/assembly/dist-rel.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&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.
    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