org.apache.cactus.maven2.mojos
Class CactifyWarMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.cactus.maven2.mojos.CactifyWarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class CactifyWarMojo
extends org.apache.maven.plugin.AbstractMojo

A maven2 mojo that injects elements necessary to run Cactus tests into an existing WAR file.

Version:
$Id: CactifyWarMojo.java 394252 2008-04-29 04:20:17Z ptahchiev $

Field Summary
protected  java.lang.String artifactId
          ArtifactId of the artifact to be installed.
protected  java.lang.String classifier
          Classifier type of the artifact to be installed.
protected  java.lang.String groupId
          GroupId of the artifact to be installed.
protected  org.apache.maven.artifact.installer.ArtifactInstaller installer
           
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
           
protected  java.lang.String packaging
          Packaging type of the artifact to be installed.
protected  java.lang.String projectVersion
          Version of the artifact to be installed.
protected  java.lang.String version
          Version of the web.xml to create.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CactifyWarMojo()
           
 
Method Summary
 void addConfiguredEjbref(org.codehaus.cargo.module.webapp.EjbRef theEjbRef)
          Adds a configured EjbRef instance.
protected  org.codehaus.cargo.util.log.Logger createLogger()
          Create a logger.
 java.io.File createTempFile(java.lang.String thePrefix, java.lang.String theSuffix, java.io.File theParentDir, boolean isDeleteOnExit)
          A method to create the temporary files.
 void execute()
          The "main" method of the mojo.
 org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
          Getter method for the MavenArchiveConfiguration.
 java.lang.String getContext()
          Returns the context.
 java.lang.String getFileName()
          Gets the file name.
 org.apache.maven.project.MavenProject getProject()
          Getter method for the MavenProject.
 java.io.File getSrcFile()
          Returns the source file for cactification.
 void setContext(java.lang.String theContext)
          Sets the context.
 void setDestFile(java.io.File theDestFile)
          Setter method for the destFile.
 void setProject(org.apache.maven.project.MavenProject theProject)
          Setter method for the MavenProject.
 void setSrcFile(java.io.File theSrcFile)
          Sets the source file for cactification.
 void setVersion(Version theVersion)
          Sets the web-app version to use when creating a WAR file from scratch.
 void setWarArchiver(org.codehaus.plexus.archiver.war.WarArchiver theWarArchiver)
          Setter for the warArchiver so that the cactifyearmojo can set it.
 
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

installer

protected org.apache.maven.artifact.installer.ArtifactInstaller installer

localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository

groupId

protected java.lang.String groupId
GroupId of the artifact to be installed. Retrieved from POM file if specified.


artifactId

protected java.lang.String artifactId
ArtifactId of the artifact to be installed. Retrieved from POM file if specified.


projectVersion

protected java.lang.String projectVersion
Version of the artifact to be installed. Retrieved from POM file if specified


version

protected java.lang.String version
Version of the web.xml to create.


packaging

protected java.lang.String packaging
Packaging type of the artifact to be installed. Retrieved from POM file if specified


classifier

protected java.lang.String classifier
Classifier type of the artifact to be installed. For example, "sources" or "javadoc". Defaults to none which means this is the project's main jar.

Constructor Detail

CactifyWarMojo

public CactifyWarMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
The "main" method of the mojo.

Throws:
org.apache.maven.plugin.MojoExecutionException - in case an error occurs.
org.apache.maven.plugin.MojoFailureException - in case a failure occurs.

createTempFile

public java.io.File createTempFile(java.lang.String thePrefix,
                                   java.lang.String theSuffix,
                                   java.io.File theParentDir,
                                   boolean isDeleteOnExit)
A method to create the temporary files.

Parameters:
thePrefix - the prefix of the filename.
theSuffix - the suffix of the filename
theParentDir - the parent directory
isDeleteOnExit - should we delete the directories on exit?
Returns:
the temporary file

getProject

public org.apache.maven.project.MavenProject getProject()
Getter method for the MavenProject.

Returns:
the MavenProject

setProject

public void setProject(org.apache.maven.project.MavenProject theProject)
Setter method for the MavenProject.

Parameters:
project -

getArchive

public org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
Getter method for the MavenArchiveConfiguration.

Returns:
the MavenArchiveConfiguration

createLogger

protected org.codehaus.cargo.util.log.Logger createLogger()
Create a logger. If a <log> configuration element has been specified by the user then use it. If none is specified then log to the Maven 2 logging subsystem.

Returns:
the logger to use for logging this plugin's activity

getContext

public java.lang.String getContext()
Returns the context.

Returns:
java.lang.String

getSrcFile

public java.io.File getSrcFile()
Returns the source file for cactification.

Returns:
java.io.File

setContext

public void setContext(java.lang.String theContext)
Sets the context.

Parameters:
context -

setVersion

public final void setVersion(Version theVersion)
Sets the web-app version to use when creating a WAR file from scratch.

Parameters:
theVersion - The version

setSrcFile

public final void setSrcFile(java.io.File theSrcFile)
Sets the source file for cactification.

Parameters:
theSrcFile - The source file

getFileName

public java.lang.String getFileName()
Gets the file name.

Returns:
the name of the web app file

setDestFile

public void setDestFile(java.io.File theDestFile)
Setter method for the destFile.

Parameters:
destFile -

addConfiguredEjbref

public final void addConfiguredEjbref(org.codehaus.cargo.module.webapp.EjbRef theEjbRef)
Adds a configured EjbRef instance. Called by Ant.

Parameters:
theEjbRef - the EjbRef to add

setWarArchiver

public void setWarArchiver(org.codehaus.plexus.archiver.war.WarArchiver theWarArchiver)
Setter for the warArchiver so that the cactifyearmojo can set it.

Parameters:
warArchiver -


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.