title: Maven. How to include specific folder or file when assemblying project depending on is it dev build or production?
body: <p>Using maven-assembly-plugin</p>
  
  <pre><code>&lt;plugin&gt;
  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
  &lt;version&gt;2.1&lt;/version&gt;
  &lt;configuration&gt;
   &lt;descriptors&gt;
    &lt;descriptor&gt;descriptor.xml&lt;/descriptor&gt;
   &lt;/descriptors&gt;
   &lt;finalName&gt;xxx-impl-${pom.version}&lt;/finalName&gt;
   &lt;outputDirectory&gt;target/assembly&lt;/outputDirectory&gt;
   &lt;workDirectory&gt;target/assembly/work&lt;/workDirectory&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p></p>
  
  <p>in descriptor.xml file we can specify</p>
  
  <pre><code>    &lt;fileSets&gt;
      &lt;fileSet&gt;
          &lt;directory&gt;src/install&lt;/directory&gt;
          &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  </code></pre>
  
  <p>Is it possible to include specific file from this folder or sub-folder depending on profile? Or some other way...</p>
  
  <p>Like this:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;dev&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;build&gt;
              &lt;resources&gt;
                  &lt;resource&gt;
                      &lt;directory&gt;src/install/dev&lt;/directory&gt;
                      &lt;includes&gt;
                          &lt;include&gt;**/*&lt;/include&gt;
                      &lt;/includes&gt;
                  &lt;/resource&gt;
              &lt;/resources&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;prod&lt;/id&gt;
          &lt;build&gt;
              &lt;resources&gt;
                  &lt;resource&gt;
                      &lt;directory&gt;src/install/prod&lt;/directory&gt;
                      &lt;includes&gt;
                          &lt;include&gt;**/*&lt;/include&gt;
                      &lt;/includes&gt;
                  &lt;/resource&gt;
              &lt;/resources&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>But it puts resources in jar when packaging. But we need to put it in zip when assemblying as I already mentioned above :(
  Thanks!</p>