org.alfresco.maven.plugin.amp
Class AmpMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.alfresco.maven.plugin.amp.AbstractAmpMojo
          extended by org.alfresco.maven.plugin.amp.AmpMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class AmpMojo
extends AbstractAmpMojo

Build a amp/webapp.

Note this is a modification of Emmanuel Venisse's (evenisse@apache.org) WAR Mojo and has been adapted to build an Alfresco AMP.

Version:
$Id:$

Field Summary
 
Fields inherited from class org.alfresco.maven.plugin.amp.AbstractAmpMojo
archive, DEFAULT_FILE_NAME_MAPPING, DEFAULT_FILE_NAME_MAPPING_CLASSIFIER, mArchiverManager
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AmpMojo()
          default constructor
 
Method Summary
 void execute()
          Executes the WarMojo on the current project.
protected  AmpArchiver getAmpArchiver()
          get the the internal value for the ampArchiver property.
protected static File getAmpFile(File pBasedir, String pFinalName, String pClassifier)
          composes the full file name for the AMP and gets a file handle for that file TODO: what happens when nulls are passed in TODO: what does a null response mean?
protected  String getAmpName()
          get the the internal value for the ampName property.
protected  String getClassifier()
          Overload this to produce a test-war, for example.
protected  String getOutputDirectory()
          get the the internal value for the outputDirectory property.
protected  org.apache.maven.project.MavenProjectHelper getProjectHelper()
          get the the internal value for the projectHelper property.
protected  boolean isPrimaryArtifact()
          get the the internal value for the primaryArtifact property.
protected  void performPackaging(File pAmpFile)
          Generates the webapp according to the mode attribute.
protected  void setAmpArchiver(AmpArchiver pAmpArchiver)
          set the internal value for the ampArchiver property
protected  void setAmpName(String pAmpName)
          set the internal value for the ampName property
protected  void setClassifier(String pClassifier)
          set the internal value for the classifier property
protected  void setOutputDirectory(String pOutputDirectory)
          set the internal value for the outputDirectory property
protected  void setPrimaryArtifact(boolean pPrimaryArtifact)
          set the internal value for the primaryArtifact property
protected  void setProjectHelper(org.apache.maven.project.MavenProjectHelper pProjectHelper)
          set the internal value for the projectHelper property
 
Methods inherited from class org.alfresco.maven.plugin.amp.AbstractAmpMojo
addOverlay, buildAmp, buildExplodedAmp, getAmpDirectory, getAmpJarExcludes, getAmpResources, getAmpSourceDirectory, getCacheFile, getClassesDirectory, getDependentAmpExcludes, getDependentAmpIncludes, getExcludes, getFilters, getIncludes, getJarArchiver, getOutputFileNameMapping, getOverlays, getProject, getWebExcludes, getWebIncludes, getWebXml, getWorkDirectory, isUseCache, setAmpDirectory, setAmpJarExcludes, setAmpResources, setAmpSourceDirectory, setAmpSourceIncludes, setCacheFile, setClassesDirectory, setFilters, setJarArchiver, setOutputFileNameMapping, setOverlays, setProject, setUseCache, setWebXml, setWorkDirectory
 
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
 

Constructor Detail

AmpMojo

public AmpMojo()
default constructor

Method Detail

getAmpArchiver

protected AmpArchiver getAmpArchiver()
get the the internal value for the ampArchiver property.

The ampArchiver property

Returns:
Returns the internal value for the ampArchiver property.

setAmpArchiver

protected void setAmpArchiver(AmpArchiver pAmpArchiver)
set the internal value for the ampArchiver property

Parameters:
pAmpArchiver - The ampArchiver to set.

getAmpName

protected String getAmpName()
get the the internal value for the ampName property.

The ampName property

Returns:
Returns the internal value for the ampName property.

setAmpName

protected void setAmpName(String pAmpName)
set the internal value for the ampName property

Parameters:
pAmpName - The ampName to set.

getOutputDirectory

protected String getOutputDirectory()
get the the internal value for the outputDirectory property.

The outputDirectory property

Returns:
Returns the internal value for the outputDirectory property.

setOutputDirectory

protected void setOutputDirectory(String pOutputDirectory)
set the internal value for the outputDirectory property

Parameters:
pOutputDirectory - The outputDirectory to set.

isPrimaryArtifact

protected boolean isPrimaryArtifact()
get the the internal value for the primaryArtifact property.

The primaryArtifact property

Returns:
Returns the internal value for the primaryArtifact property.

setPrimaryArtifact

protected void setPrimaryArtifact(boolean pPrimaryArtifact)
set the internal value for the primaryArtifact property

Parameters:
pPrimaryArtifact - The primaryArtifact to set.

getProjectHelper

protected org.apache.maven.project.MavenProjectHelper getProjectHelper()
get the the internal value for the projectHelper property.

The projectHelper property

Returns:
Returns the internal value for the projectHelper property.

setProjectHelper

protected void setProjectHelper(org.apache.maven.project.MavenProjectHelper pProjectHelper)
set the internal value for the projectHelper property

Parameters:
pProjectHelper - The projectHelper to set.

getClassifier

protected String getClassifier()
Overload this to produce a test-war, for example.


setClassifier

protected void setClassifier(String pClassifier)
set the internal value for the classifier property

Parameters:
pClassifier - The classifier to set.

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Executes the WarMojo on the current project.

Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occured while building the webapp
org.apache.maven.plugin.MojoFailureException

getAmpFile

protected static File getAmpFile(File pBasedir,
                                 String pFinalName,
                                 String pClassifier)
composes the full file name for the AMP and gets a file handle for that file TODO: what happens when nulls are passed in TODO: what does a null response mean?

Parameters:
pBaseDir - Base directory for AMP
pFileName - Final Name of AMP
pClassifier - TODO: fill this in

performPackaging

protected void performPackaging(File pAmpFile)
                         throws IOException,
                                org.codehaus.plexus.archiver.ArchiverException,
                                org.codehaus.plexus.archiver.jar.ManifestException,
                                org.apache.maven.artifact.DependencyResolutionRequiredException,
                                org.apache.maven.plugin.MojoExecutionException,
                                org.apache.maven.plugin.MojoFailureException
Generates the webapp according to the mode attribute.

Parameters:
pAmpFile - the target AMP file
Throws:
IOException
org.codehaus.plexus.archiver.ArchiverException
org.codehaus.plexus.archiver.jar.ManifestException
org.apache.maven.artifact.DependencyResolutionRequiredException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException


Copyright © 2009 Alfresco. All Rights Reserved.