org.jvnet.hudson.maven.plugins.hpi
Class AbstractHpiMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.jvnet.hudson.maven.plugins.hpi.AbstractHpiMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
HpiMojo, HplMojo

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


Field Summary
protected  org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
          To look up Archiver/UnArchiver implementations
protected  String outputDirectory
          The directory for the generated WAR.
protected  String pluginName
          Name of the plugin that Hudson uses for display purpose.
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  File warSourceDirectory
          Single directory for extra files to include in the WAR.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractHpiMojo()
           
 
Method Summary
 void buildExplodedWebapp(File webappDirectory)
           
 void buildWebapp(org.apache.maven.project.MavenProject project, File webappDirectory)
          Builds the webapp for the specified project.
 void copyResources(File sourceDirectory, File webappDirectory)
          Copies webapp webResources from the specified directory.
 void copyResources(org.apache.maven.model.Resource resource, File webappDirectory, Properties filterProperties)
          Copies webapp webResources from the specified directory.
 File getClassesDirectory()
           
 File getContainerConfigXML()
           
protected  String[] getDependentWarExcludes()
          Returns a string array of the excludes to be used when adding dependent wars as an overlay onto this war.
protected  String[] getDependentWarIncludes()
          Returns a string array of the includes to be used when adding dependent wars as an overlay onto this war.
protected  String[] getExcludes()
          Returns a string array of the excludes to be used when assembling/copying the war.
protected  String[] getIncludes()
          Returns a string array of the includes to be used when assembling/copying the war.
 File getWebappDirectory()
           
protected  void setAttributes(org.codehaus.plexus.archiver.jar.Manifest.Section mainSection)
           
 void setClassesDirectory(File classesDirectory)
           
 void setContainerConfigXML(File containerConfigXML)
           
 void setWarSourceDirectory(File warSourceDirectory)
           
 void setWebappDirectory(File webappDirectory)
           
 
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
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

outputDirectory

protected String outputDirectory
The directory for the generated WAR.


project

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


pluginName

protected String pluginName
Name of the plugin that Hudson uses for display purpose. It should be one line text.


warSourceDirectory

protected File warSourceDirectory
Single directory for extra files to include in the WAR.


archiverManager

protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
To look up Archiver/UnArchiver implementations

Constructor Detail

AbstractHpiMojo

public AbstractHpiMojo()
Method Detail

getClassesDirectory

public File getClassesDirectory()

setClassesDirectory

public void setClassesDirectory(File classesDirectory)

getWebappDirectory

public File getWebappDirectory()

setWebappDirectory

public void setWebappDirectory(File webappDirectory)

setWarSourceDirectory

public void setWarSourceDirectory(File warSourceDirectory)

getContainerConfigXML

public File getContainerConfigXML()

setContainerConfigXML

public void setContainerConfigXML(File containerConfigXML)

getExcludes

protected String[] getExcludes()
Returns a string array of the excludes to be used when assembling/copying the war.

Returns:
an array of tokens to exclude

getIncludes

protected String[] getIncludes()
Returns a string array of the includes to be used when assembling/copying the war.

Returns:
an array of tokens to include

getDependentWarExcludes

protected String[] getDependentWarExcludes()
Returns a string array of the excludes to be used when adding dependent wars as an overlay onto this war.

Returns:
an array of tokens to exclude

getDependentWarIncludes

protected String[] getDependentWarIncludes()
Returns a string array of the includes to be used when adding dependent wars as an overlay onto this war.

Returns:
an array of tokens to include

buildExplodedWebapp

public void buildExplodedWebapp(File webappDirectory)
                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

copyResources

public void copyResources(org.apache.maven.model.Resource resource,
                          File webappDirectory,
                          Properties filterProperties)
                   throws IOException
Copies webapp webResources from the specified directory.

Note that the webXml parameter could be null and may specify a file which is not named web.xml. If the file exists, it will be copied to the META-INF directory and renamed accordingly.

Parameters:
resource - the resource to copy
webappDirectory - the target directory
filterProperties -
Throws:
IOException - if an error occurred while copying webResources

copyResources

public void copyResources(File sourceDirectory,
                          File webappDirectory)
                   throws IOException
Copies webapp webResources from the specified directory.

Note that the webXml parameter could be null and may specify a file which is not named web.xml. If the file exists, it will be copied to the META-INF directory and renamed accordingly.

Parameters:
sourceDirectory - the source directory
webappDirectory - the target directory
Throws:
IOException - if an error occurred while copying webResources

buildWebapp

public void buildWebapp(org.apache.maven.project.MavenProject project,
                        File webappDirectory)
                 throws org.apache.maven.plugin.MojoExecutionException,
                        IOException
Builds the webapp for the specified project.

Classes, libraries and tld files are copied to the webappDirectory during this phase.

Parameters:
project - the maven project
webappDirectory -
Throws:
IOException - if an error occurred while building the webapp
org.apache.maven.plugin.MojoExecutionException

setAttributes

protected void setAttributes(org.codehaus.plexus.archiver.jar.Manifest.Section mainSection)
                      throws org.apache.maven.plugin.MojoExecutionException,
                             org.codehaus.plexus.archiver.jar.ManifestException,
                             IOException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.codehaus.plexus.archiver.jar.ManifestException
IOException


Copyright © 2011. All Rights Reserved.