View Javadoc
1   package org.apache.maven.plugins.site.deploy;
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 914946 2014-07-03 23:00:36Z hboutemy $
38   * @since 2.0
39   */
40  @Mojo( name = "deploy" )
41  public class SiteDeployMojo
42      extends AbstractDeployMojo
43  {
44      @Override
45      protected boolean isDeploy()
46      {
47          return true;
48      }
49  
50      /**
51       * Deploy distribution site url is directly the current project value.
52       */
53      @Override
54      protected String determineTopDistributionManagementSiteUrl()
55          throws MojoExecutionException
56      {
57          return getDeploySite().getUrl();
58      }
59  
60      /**
61       * Deploy directly to the current project's distribution management site.
62       */
63      @Override
64      protected Site determineDeploySite()
65          throws MojoExecutionException
66      {
67          return getSite( getTopLevelProject( project ) );
68      }
69  }