diff --git a/site/plugin.jelly b/site/plugin.jelly index 54602b4f..57458f66 100644 --- a/site/plugin.jelly +++ b/site/plugin.jelly @@ -27,16 +27,14 @@ + - - + @@ -89,7 +87,10 @@ + + + site clean = ${siteClean} siteDirectory = ${siteDirectory} @@ -177,9 +178,7 @@ - - - + @@ -239,11 +238,27 @@ Source and destination is identical - - - - - + + + + Executing filesystem copy on local server to publish + + + + + + Executing filesystem copy on remote server to publish + + + + + + Executing rsync on stage server to publish to live server + + + + + @@ -262,3 +277,4 @@ + diff --git a/site/plugin.properties b/site/plugin.properties index 6ff83be1..6f9e8db3 100644 --- a/site/plugin.properties +++ b/site/plugin.properties @@ -34,3 +34,4 @@ maven.rsync.executable=rsync maven.username=USERNAME_NOT_SET +maven.site.deploy.clean=false diff --git a/site/xdocs/index.xml b/site/xdocs/index.xml index ec1d47e3..77d459ee 100644 --- a/site/xdocs/index.xml +++ b/site/xdocs/index.xml @@ -22,14 +22,140 @@ Maven Site Plug-in Jason van Zyl + Brett Porter

This plug-in is used to generate the documentation site for your - project. + project. This includes both transforming your custom xdoc documents into + XHTML (see the xdoc plugin), and + running the designated reports for your project. The result is then + packaged or deployed in the form that you desire.

+ + +

+ To generate the site for your project, run: +

+ maven site:site +

+ The resulting site is created in target/docs (or whatever the + maven.docs.dest property is set to). +

+
+ +

+ There are several alternatives for deploying and packaging the site. +

+

+ If you would like to package a single redistributable version of the site, + you can create a J2EE WAR or an EAR using the goals site:war + or site:ear respectively. The site archive will be placed in + the target directory. +

+

+ If you would like to deploy the site to a directory either locally or on a remote + host, you can use: +

+ maven site:deploy +

+ From there, it can be served from a web server. +

+

+ There are several different deployment mechanisms, which are listed in the table below. + You can use them by setting the maven.site.deploy.method property appropriately, + or by running the given goal directly (which will not generate the site first, making it + appropriate if the site has already been generated - for example after the multiproject:site + goal). +

+

+ Where the site is deployed to is controlled by the pom.siteAddress and + pom.siteDirectory properties, which control the server and absolute directory + respectively. +

+ + + + + + + + + + + + + + + + + + + + + + + + +
MethodGoalDescription
sshsite:sshdeploy + This uses SSH to transfer the files. The site is first packaged into a compressed tar archive, + transferred using scp, then uncompressed using remote commands via ssh. + This method requires that you have ssh and scp locally (PuTTY will suffice + as long as your properties are set correctly - see the FAQ). + It also requires that your remote server has an SSH server running, with tar and + gunzip available. This also requires that you have a suitable SSH agent and private + key set up such that you can log in to the remote server without having to enter a password. +
ftpsite:ftpdeploy + This uses FTP to transfer the files. The site directory is recursively copied to the remote server. + Note that unused files will not be removed. This method requires that an FTP server be running on the + remote server. +
rsyncsite:rsyncdeploy + This uses rsync to transfer the files. This requires that you have rsync + installed both locally and remotely, that RSYNC_RSH is set correctly, and that you can + login remotely without having to enter a password. This is usually done over SSH, as described above. + By default, this method does not remove unused files: set the maven.site.deploy.clean + property to true if this is desired. +
fssite:fseploy + This method copies the site to a location on the local filesystem. + By default, this method does not remove unused files: set the maven.site.deploy.clean + property to true if this is desired. +
+
+ +

+ In some cases, you may want to publish the site in two stages. This facilitates reviewing the site + before it goes live, or having a backup location of the site. +

+

+ To enable this method, set the maven.site.stage.address and/or + maven.site.stage.directory properties. These are equivalent to the properties set in the + POM, but designate the location of the staging server. If one of these properties is not specified, + it will default to the same value as the POM for the staging server. +

+

+ Once these properties are set, the site:deploy goal (including the individual method + deployment goals) will publish to the staging environment instead. +

+

+ To publish the site live, run: +

+ maven site:publish +

+ Note that, unless you are publishing with both source and destination locally, this goal requires that an + SSH server is running on both the live and stage servers, and that + both have the rsync executable. You must have permission to SSH to the stage server without + entering a password using an SSH agent, and the stage server must likewise be able to SSH to the + live server if it is different. Additionally, the target directory must exist on the live server. +

+

+ If this configuration can not be enabled for your environment, you should publish the site a second + time from your local environment to publish it live. This can be accomplished by running: +

+ maven site:deploy -Dmaven.site.deploy.live=true +
+ diff --git a/site/xdocs/properties.xml b/site/xdocs/properties.xml index 7b286250..f7309481 100644 --- a/site/xdocs/properties.xml +++ b/site/xdocs/properties.xml @@ -51,6 +51,16 @@ Force the use of the live deployment parameters, even if the staging ones are specified + + maven.site.deploy.clean + Yes + + This will ensure the target in either a site:deploy or site:publish goal is + clean by either deleting the directory first, or rsync'ing with the --delete option. + This operation is not atomic, so is not recommended for the live site unless you are using the rsync + method. + + maven.scp.executable Yes