title: Maven site plugin to deploy snapshots and releases separately?
body: <p>I would like to deploy a site for a hierarchy of Maven projects differently for snapshots and releases (i.e. <a href="http://example.org" rel="nofollow">http://example.org</a> for releases and <a href="http://dev.example.org" rel="nofollow">http://dev.example.org</a> for snapshots) and keep the project hierarchy (parents, children, modules) correct with proper links.</p>
  
  <p>My attempt was to assign properties to hold the "current" site information as well as properties to hold each possible type of site (i.e. dev, stable, etc.). I would then use a profile to switch the site info at release time. The following is an example of what I mean.</p>
  
  <p>Parent POM snippet:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
  ...
  
      &lt;url&gt;http://${site.host}/&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;site.host.stable&gt;example.org&lt;/site.host.stable&gt;
          &lt;site.host.stable.desc&gt;PARENT-STABLE&lt;/site.host.stable.desc&gt;
  
          &lt;site.host.dev&gt;dev.example.org&lt;/site.host.dev&gt;
          &lt;site.host.dev.desc&gt;PARENT-DEV&lt;/site.host.dev.desc&gt;
  
          &lt;site.host&gt;${site.host.dev}&lt;/site.host&gt;
          &lt;site.host.other&gt;${site.host.stable}&lt;/site.host.other&gt;
          &lt;site.host.other.desc&gt;${site.host.stable.desc}&lt;/site.host.other.desc&gt;
      &lt;/properties&gt;
  
      &lt;distributionManagement&gt;
          &lt;site&gt;
              &lt;id&gt;site-deploy-id&lt;/id&gt;
              &lt;url&gt;.../var/www/${site.host}&lt;/url&gt;
          &lt;/site&gt;
      &lt;/distributionManagement&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;example-release&lt;/id&gt;
              &lt;properties&gt;
                  &lt;site.host&gt;${site.host.stable}&lt;/site.host&gt;
                  &lt;site.host.other&gt;${site.host.dev}&lt;/site.host.other&gt;
                  &lt;site.host.other.desc&gt;${site.host.dev.desc}&lt;/site.host.other.desc&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>Example parent site descriptor:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
      &lt;body&gt;
          &lt;links&gt;
              &lt;item name="${site.host.other.desc}" href="http://${site.host.other}" /&gt;
          &lt;/links&gt;
      &lt;/body&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Example child site descriptor:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
      &lt;body&gt;
          &lt;menu ref="parent"/&gt;
      &lt;/body&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The distribution management part of this works perfectly and deploys the files as I would expect (to the proper directory on the target machine based on the active profile).</p>
  
  <p>For the actual site part:</p>
  
  <p>With version 2.2 of the site plugin, this works fine for the parent site, but all descendant sites revert back to the snapshot or "dev" version even when the release profile specified is active. With version 3.0 of the site plugin, the following message is printed and (as stated) no parent menu is created. The links section acts like version 2.2.</p>
  
  <pre><code>[WARNING] Unable to find a URL to the parent project. The parent menu will NOT be added.
  </code></pre>
  
  <p>Using the properties-maven-plugin from codehaus, I am able to see that the profile properties are applied correctly, but the site plugin seems to ignore this.</p>
  
  <p>Is there a better way to accomplish what I am trying to do? Is this a bug, or have I made a mistake somewhere?</p>