View Javadoc

1   package org.apache.maven.plugins.site;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.model.Site;
23  import org.apache.maven.plugin.MojoExecutionException;
24  import org.apache.maven.plugins.annotations.Mojo;
25  
26  /**
27   * Deploys the generated site using <a href="/wagon/">wagon supported
28   * protocols</a> to the site URL specified in the
29   * <code>&lt;distributionManagement&gt;</code> section of the POM.
30   * <p>
31   * For <code>scp</code> protocol, the website files are packaged by wagon into zip archive,
32   * then the archive is transfered to the remote host, next it is un-archived which is much faster
33   * than making a file by file copy.
34   * </p>
35   *
36   * @author <a href="mailto:michal@org.codehaus.org">Michal Maczka</a>
37   * @version $Id: SiteDeployMojo.html 861484 2013-05-09 23:10:16Z hboutemy $
38   */
39  @Mojo( name = "deploy" )
40  public class SiteDeployMojo
41      extends AbstractDeployMojo
42  {
43      @Override
44      protected boolean isDeploy()
45      {
46          return true;
47      }
48  
49      /**
50       * Deploy distribution site url is directly the current project value.
51       */
52      @Override
53      protected String determineTopDistributionManagementSiteUrl()
54          throws MojoExecutionException
55      {
56          return getDeploySite().getUrl();
57      }
58  
59      /**
60       * Deploy directly to the current project's distribution management site.
61       */
62      @Override
63      protected Site determineDeploySite()
64          throws MojoExecutionException
65      {
66          return getSite( getTopLevelProject( project ) );
67      }
68  }