title: Maven: Copy resources to dynamic directory
body: <p>I'm a Maven newbie and my project is finally compiling and running correctly.</p>
  
  <p>On each run my project writes reports on a dynamic location created at runtime (<code>username_timestamp</code>) and sets a <code>System.property</code> called <code>REPORTS_LOCATION</code> with this location. After execution I would like to copy some static resources (style, images, js, etc) to this dynamic folder using a maven goal.</p>
  
  <p>What I can't figure out is how to let Maven know about this dynamic location or access this System.property</p>
  
  <p>I'm about ready to just let my project copy these resources to the directory but I figure I'll give it another try in case there is an easy/Maven way of doing this.</p>
  
  <p>I've gotten as far as copying the resources to a hard coded location. Here is a snippet of the POM. I'm using Jbehave's Maven goals and they do execute in order</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugins&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.jbehave&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;${jbehave.core.version}&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;embeddable-stories&lt;/id&gt;
          &lt;phase&gt;integration-test&lt;/phase&gt;
          &lt;configuration&gt;
            &lt;includes&gt;
              &lt;include&gt;**/Stories.java&lt;/include&gt;
            &lt;/includes&gt;
            &lt;excludes /&gt;
            &lt;metaFilters&gt;
              &lt;metaFilter&gt;${meta.filter}&lt;/metaFilter&gt;
            &lt;/metaFilters&gt;
          &lt;/configuration&gt;
          &lt;goals&gt;
            &lt;goal&gt;run-stories-as-embeddables&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
        &lt;!-- Copy the resources AFTER the execution is done --&gt;
        &lt;execution&gt;
          &lt;id&gt;unpack-view-resources&lt;/id&gt;
          &lt;phase&gt;integration-test&lt;/phase&gt;
          &lt;configuration&gt;
              &lt;viewDirectory&gt;${basedir}/src/main/java/project/reports/{NEED TO FEED DIRECTORY HERE}&lt;/viewDirectory&gt;
          &lt;/configuration&gt;
          &lt;goals&gt;
            &lt;goal&gt;unpack-view-resources&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
  </code></pre>