com.perforce.maven.mojo
Class P4Mojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.perforce.maven.mojo.P4Mojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
P4JobsMojo, P4ShelveMojo, P4UnShelveMojo

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

Super class for Perforce Mojos.


Field Summary
protected  String excludes
          The excludes that is used to include files with that pattern.
protected  String includes
          The includes that is used to include files with that pattern.
protected  org.apache.maven.scm.log.ScmLogDispatcher logger
           
protected  String password
          The password that is used when connecting to the SCM system.
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  List reactorProjects
          Contains the full list of projects in the reactor.
protected  File scmDirectory
          Local directory to be used to issue SCM actions
protected  org.apache.maven.scm.manager.ScmManager scmManager
           
protected  org.apache.maven.execution.MavenSession session
           
protected  String urlScm
           
protected  String username
          The username that is used when connecting to the SCM system.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
P4Mojo()
           
 
Method Summary
protected  void checkResult(org.apache.maven.scm.ScmResult result)
           
 void execute()
           
abstract  org.apache.maven.scm.ScmResult executeP4Command()
           
protected  org.apache.maven.scm.log.ScmLogger getLogger()
           
protected  org.codehaus.plexus.util.xml.Xpp3Dom getScmPluginConfiguration()
           
protected  org.apache.maven.scm.repository.ScmRepository getScmRepository()
           
 List getStatus()
           
static boolean isEmpty(String value)
          Checks if is empty.
static int parseChangelist(String changelist)
          Parse the changelist string to a changelist number.
 void setExcludes(String excludes)
           
 void setIncludes(String includes)
           
 void setPassword(String password)
           
 void setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)
           
 void setUrlScm(String urlScm)
           
 void setUsername(String username)
           
 
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

urlScm

protected String urlScm

username

protected String username
The username that is used when connecting to the SCM system.


password

protected String password
The password that is used when connecting to the SCM system.


includes

protected String includes
The includes that is used to include files with that pattern.


excludes

protected String excludes
The excludes that is used to include files with that pattern.


scmDirectory

protected File scmDirectory
Local directory to be used to issue SCM actions


scmManager

protected org.apache.maven.scm.manager.ScmManager scmManager

project

protected org.apache.maven.project.MavenProject project
The maven project.


reactorProjects

protected List reactorProjects
Contains the full list of projects in the reactor.

Since:
1.0-beta-3

session

protected org.apache.maven.execution.MavenSession session

logger

protected org.apache.maven.scm.log.ScmLogDispatcher logger
Constructor Detail

P4Mojo

public P4Mojo()
Method Detail

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

executeP4Command

public abstract org.apache.maven.scm.ScmResult executeP4Command()
                                                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getStatus

public List getStatus()
               throws org.apache.maven.scm.ScmException
Throws:
org.apache.maven.scm.ScmException

getLogger

protected org.apache.maven.scm.log.ScmLogger getLogger()
Returns:

getScmRepository

protected org.apache.maven.scm.repository.ScmRepository getScmRepository()
                                                                  throws org.apache.maven.scm.ScmException
Throws:
org.apache.maven.scm.ScmException

checkResult

protected void checkResult(org.apache.maven.scm.ScmResult result)
                    throws org.apache.maven.scm.ScmException
Throws:
org.apache.maven.scm.ScmException

getScmPluginConfiguration

protected org.codehaus.plexus.util.xml.Xpp3Dom getScmPluginConfiguration()

parseChangelist

public static int parseChangelist(String changelist)
Parse the changelist string to a changelist number. Convert the "default" changelist string to the default changelist number. If it is negative return unknown changelist. Otherwise, return the converted changelist number.

Parameters:
changelist - the changelist
Returns:
the int

setScmManager

public void setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)

setUrlScm

public void setUrlScm(String urlScm)

setUsername

public void setUsername(String username)

setPassword

public void setPassword(String password)

setIncludes

public void setIncludes(String includes)

setExcludes

public void setExcludes(String excludes)

isEmpty

public static boolean isEmpty(String value)
Checks if is empty.

Parameters:
value - the value
Returns:
true, if is empty


Copyright © 2011 Perforce Software. All Rights Reserved.