[ 
http://jira.codehaus.org/browse/MSITE-277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191915#action_191915
 ] 

Richard Gomes commented on MSITE-277:
-------------------------------------

Hi,

I had a bad time too with this 'issue'/functionality... depending how you need 
it.
Yes... It would be handy to tell Maven that I use flat project model.

Below you can see how I organized my master POM.

{noformat}
    <!-- This is the master POM -->
    </distributionManagement>
        ...
        <!-- NOTES:
          * maven-site-plugin gets confused by flat project model employed by 
Eclipse :(
          
          * It's also confused to configure an staging URL because 
maven-site-plugin takes
             the staging URL from <configuration> and not from 
<distributionManagement>.
          
          * We circumvented these difficulties by tweaking siteURL depending on 
a profile.
             So, in order to 'deploy' to a staging server, please define a 
profile called 
             'staging' in your settings.xml file like shown below:
           
                 <settings>
                    ...
                    <profiles>
                        <profile>
                            <id>staging</id>
                            <properties>
                                
<props.site.deploy.url>scp://localhost:/srv/jquantlib.org/sites</props.site.deploy.url>
                            </properties>
                        </profile>
                    </profiles>
                    ...
                 </settings>
           
             You can deploy to a staging server like this:
           
                  mvn clean site-deploy -P staging
           
             The big drawback is that we have only one <site> for 2 purposes, 
which is not very good :(
             One way to circumvent this problem is deploying via file: protocol 
to your local web server.
          
          * Every project MUST REDEFINE the <site> section as it is (no 
modification are needed!) in order
             to override the way Maven promoves inheritance which supposes a 
hierarchical model.
        -->
        <site>
            <id>site</id>
            <name>${project.artifactId} site generated by Maven</name>
            <url>${props.site.deploy.url}/${project.artifactId}</url>
        </site>

    </distributionManagement>
{noformat}

... and all projects need to copy/paste the same block :( 

{noformat}
    <-- This is a 'child' project -->
    <distributionManagement>
        <!-- NOTE: <site> entry cannot be inherited.
               It means to say you need to copy/paste this text as it is to all 
child projects.
               See comments in the parent POM for more information.
          -->
        <site>
            <id>site</id>
            <name>${project.project.artifactId} site generated by Maven</name>
            <url>${props.site.deploy.url}/${project.artifactId}</url>
        </site>
    </distributionManagement>
{noformat}

As you can see, the trick is defining a profile 'staging' in settings.xml:

{noformat}
<settings>
        ...
        <profiles>
        <profile>
                <id>staging</id>
                <properties>
                
<props.site.deploy.url>file:///srv/jquantlib.org/sites</props.site.deploy.url>
                </properties>
        </profile>
        </profiles>
        ...
</settings>
{noformat}
Note: I'm using file: protocol in order to deploy to my local webserver.

And then you can call Maven like this:

{noformat}
mvn clean site-deploy -P staging
{noformat}


> site:deploy possibility to choose directory tree when using sub-modules
> -----------------------------------------------------------------------
>
>                 Key: MSITE-277
>                 URL: http://jira.codehaus.org/browse/MSITE-277
>             Project: Maven 2.x Site Plugin
>          Issue Type: Improvement
>          Components: site:deploy
>    Affects Versions: 2.0-beta-6
>            Reporter: Guimiot Isabelle
>            Priority: Minor
>
> I use Eclipse and my modules (root and submodules) are all at the same level 
> in the directory tree :
> [eclipse_workspace]/root
> [eclipse_workspace]/sub1
> [eclipse_workspace]/sub2
> Until the 2.0-beta-5 of the maven site plugin, when I deployed my site, I 
> obtained this tree :
> [publish]/root
> [publish]/root/sub1
> [publish]/root/sub2
> I installed the beta-6 version, and the default behaviour has changed, I now 
> have every module at the same level :
> [publish]/root
> [publish]/sub1
> [publish]/sub2
> So I just wondered if it was possible to have an option to choose whether we 
> prefer to publish the submodules inside the root directory, or at the same 
> level... ?
> thx
> Isabelle

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to