[ 
https://issues.apache.org/jira/browse/MSITE-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15112499#comment-15112499
 ] 

Andy Brook commented on MSITE-761:
----------------------------------

Hi Gordon,
Thanks for that, I didn't spot that field, however, its only seeming to do half 
of the job, plugin config with that looks like (shame about abs path, but it 
works):
{noformat}
                <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-site-plugin</artifactId>
                           <version>3.4</version>
                           <dependencies>
                        <dependency><!-- add support for ssh/scp -->
                                <groupId>org.apache.maven.wagon</groupId>
                                <artifactId>wagon-ssh</artifactId>
                                <version>2.10</version>
                                </dependency>
                        </dependencies>
                           <configuration>
                              
<stagingDirectory>/tmp/${project.version}</stagingDirectory>
                               ....
                           </configuration>   
                   </plugin> 
{noformat}

With this {{site:site}} generates $\{basedir}/target/site , {{site:stage}} does 
then copy that content into /tmp/$\{project.version} but, {{site:stage-deploy}} 
results in the behaviour I see without 'stagingDirectory' set at all:

{noformat}
[INFO] Using this base URL for stage deploy: 
scp://docs/var/www/html/aaaa/staging/ <-------------------------- ( 1 )
Using private key: /home/andy/.ssh/id_rsa
Password for andy@docs: xxxxxxxxxxxxxx
scp://uat-sonar/var/www/html/aaaa/staging/ - Session: Opened  
[INFO] Pushing /home/andy/workspace/aaaa/target/site  
<---------------------------------------- ( 2 )
[INFO]    >>> to scp://uat-sonar/var/www/html/aaaa/staging/./
Executing command: mkdir -p "/var/www/html/aaaa/staging/./"
Executing command: mkdir -p "/var/www/html/aaaa/staging/."
Executing command: scp -t 
"/var/www/html/aaaa/staging/./wagon720773497834503151.zip"
Uploading: ./wagon720773497834503151.zip to 
scp://uat-sonar/var/www/html/aaaa/staging/

#################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
Transfer finished. 11338332 bytes copied in 0.116 seconds
Executing command: cd "/var/www/html/aaaa/staging/./"; unzip -q -o 
"wagon720773497834503151.zip"; rm -f "wagon720773497834503151.zip"
Executing command: chmod -Rf g+w,a+rX /var/www/html/aaaa/staging/
scp://uat-sonar/var/www/html/aaaa/staging/ - Session: Disconnecting  
scp://uat-sonar/var/www/html/aaaa/staging/ - Session: Disconnected
[INFO] ----------------------------------------------------------------
{noformat}

What we see there is in ( 1 ) where the staging folder is "staging" not the 
same as the local staging folder $\{project.version}, and in ( 2 ), regardless 
of the local staging folder, the folder path used to deploy is the local site 
folder, not the staged $\{project.version}

It may be possible to type in exact folders as runtime params, but it defeats 
what I want, a simple quick way to automate maven sites by version to a remote 
web-host, Id hope to achieve this through configuration and {{site:site 
site:stage site:stage-deploy}}

Do you see anything I'm doing wrong?

> Enable deployed site folder to be configurable, eg $project.version not just 
> "staging"
> --------------------------------------------------------------------------------------
>
>                 Key: MSITE-761
>                 URL: https://issues.apache.org/jira/browse/MSITE-761
>             Project: Maven Site Plugin
>          Issue Type: Improvement
>          Components: site:stage(-deploy)
>    Affects Versions: 3.4
>            Reporter: Andy Brook
>
> The site deploy, when configured with a pom distributionManagement url zips 
> up the local "staging" (hard-coded within the site plugin?) folder and 
> unpacks it at the given URL.  As the folder I nominated above is the 
> _project_ folder, I want the target folder to be the current 
> $\{project.version} but there doesn't seem a way to make it do that.  As a 
> result, every time I build, I clobber the current version.  I track many 
> branches, and versions, and want to have access to them all.
> I'd like to add site configuration param like:
> {noformat}
> <siteFolder>${project.version}</siteFolder>
> {noformat}
> So that a version 1.2.3 site-deploy ends up as:
> {noformat}
> scp://webserver/var/www/html/product/1.2.3
> {noformat}
> MSITE-617 could possibly do this, however, this is a very specific slice of 
> that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to