org.apache.maven.plugins.scmpublish
Class AbstractScmPublishMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugins.scmpublish.AbstractScmPublishMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ScmPublishInventoryMojo, ScmPublishPublishMojo

public abstract class AbstractScmPublishMojo
extends org.apache.maven.plugin.AbstractMojo

Base class for the scm-publish mojos.


Field Summary
protected  boolean automaticRemotePathCreation
          for svn avoid automatic remote url create
protected  File basedir
           
protected  File checkoutDirectory
          Location where the scm check-out is done.
protected  String excludes
          Patterns to exclude from the scm tree.
protected  String[] ignorePathsToDelete
          Collections of paths to not delete when checking content to delete.
protected  String includes
          Patterns to include in the scm tree.
protected  File inventoryFile
          Location of the inventory file.
protected  boolean localCheckout
          Use a local checkout instead of doing a checkout from the upstream repository.
protected  String password
          The SCM password to use.
protected  String pubScmUrl
          Location of the scm publication tree.
protected  String scmBranch
          for github you must configure with gh-pages
protected  org.apache.maven.scm.provider.ScmProvider scmProvider
           
protected  org.apache.maven.scm.repository.ScmRepository scmRepository
           
protected  org.apache.maven.shared.release.scm.ScmRepositoryConfigurator scmRepositoryConfigurator
          Tool that gets a configured SCM repository from release configuration.
protected  org.apache.maven.execution.MavenSession session
           
protected  org.apache.maven.settings.Settings settings
           
protected  String siteOutputEncoding
          The outputEncoding parameter of the site plugin.
protected  boolean skipDeletedFiles
          Do not delete files to the scm
protected  boolean tryUpdate
          if the checkout directory exists and this flag is activated the plugin will try an update rather than delete then checkout
protected  String username
          The SCM username to use.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
protected AbstractScmPublishMojo()
           
 
Method Summary
protected  void checkoutExisting()
           
 void execute()
           
protected  void logError(String format, Object... params)
           
protected  void logInfo(String format, Object... params)
           
abstract  void scmPublishExecute()
           
protected  org.apache.maven.shared.release.config.ReleaseDescriptor setupScm()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inventoryFile

@Parameter(property="scmpublish.inventoryFile",
           defaultValue="${project.build.directory}/scmpublish-inventory.js")
protected File inventoryFile
Location of the inventory file.


pubScmUrl

@Parameter(property="scmpublish.pubScmUrl",
           defaultValue="${project.distributionManagement.site.url}",
           required=true)
protected String pubScmUrl
Location of the scm publication tree.


checkoutDirectory

@Parameter(property="scmpublish.checkoutDirectory",
           defaultValue="${project.build.directory}/scmpublish-checkout")
protected File checkoutDirectory
Location where the scm check-out is done.


excludes

@Parameter
protected String excludes
Patterns to exclude from the scm tree.


includes

@Parameter
protected String includes
Patterns to include in the scm tree.


scmRepositoryConfigurator

@Component
protected org.apache.maven.shared.release.scm.ScmRepositoryConfigurator scmRepositoryConfigurator
Tool that gets a configured SCM repository from release configuration.


username

@Parameter(property="username")
protected String username
The SCM username to use.


password

@Parameter(property="password")
protected String password
The SCM password to use.


localCheckout

@Parameter(property="localCheckout",
           defaultValue="false")
protected boolean localCheckout
Use a local checkout instead of doing a checkout from the upstream repository. ATTENTION: This will only work with distributed SCMs which support the file:// protocol TODO: we should think about having the defaults for the various SCM providers provided via modello!


siteOutputEncoding

@Parameter(property="outputEncoding",
           defaultValue="${project.reporting.outputEncoding}")
protected String siteOutputEncoding
The outputEncoding parameter of the site plugin. This plugin will corrupt your site if this does not match the value used by the site plugin.


tryUpdate

@Parameter(property="scmpublish.tryUpdate",
           defaultValue="false")
protected boolean tryUpdate
if the checkout directory exists and this flag is activated the plugin will try an update rather than delete then checkout


skipDeletedFiles

@Parameter(property="scmpublish.skipDeletedFiles",
           defaultValue="false")
protected boolean skipDeletedFiles
Do not delete files to the scm


basedir

@Parameter(defaultValue="${basedir}",
           readonly=true)
protected File basedir

settings

@Component
protected org.apache.maven.settings.Settings settings

session

@Component
protected org.apache.maven.execution.MavenSession session

ignorePathsToDelete

@Parameter
protected String[] ignorePathsToDelete
Collections of paths to not delete when checking content to delete. If your site has subdirectories published by an other mechanism/build


scmBranch

@Parameter(property="scmpublish.scm.branch")
protected String scmBranch
for github you must configure with gh-pages


automaticRemotePathCreation

@Parameter(property="scmpublish.automaticRemotePathCreation",
           defaultValue="true")
protected boolean automaticRemotePathCreation
for svn avoid automatic remote url create


scmProvider

protected org.apache.maven.scm.provider.ScmProvider scmProvider

scmRepository

protected org.apache.maven.scm.repository.ScmRepository scmRepository
Constructor Detail

AbstractScmPublishMojo

protected AbstractScmPublishMojo()
Method Detail

logInfo

protected void logInfo(String format,
                       Object... params)

logError

protected void logError(String format,
                        Object... params)

setupScm

protected org.apache.maven.shared.release.config.ReleaseDescriptor setupScm()
                                                                     throws org.apache.maven.scm.repository.ScmRepositoryException,
                                                                            org.apache.maven.scm.manager.NoSuchScmProviderException
Throws:
org.apache.maven.scm.repository.ScmRepositoryException
org.apache.maven.scm.manager.NoSuchScmProviderException

checkoutExisting

protected void checkoutExisting()
                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

scmPublishExecute

public abstract void scmPublishExecute()
                                throws org.apache.maven.plugin.MojoExecutionException,
                                       org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.