Package org.apache.maven.plugin.ear
Class WebModule
- java.lang.Object
-
- org.apache.maven.plugin.ear.AbstractEarModule
-
- org.apache.maven.plugin.ear.WebModule
-
- All Implemented Interfaces:
EarModule
public class WebModule extends AbstractEarModule
TheEarModule
implementation for a Web application module.- Version:
- $Id: WebModule.java 1645331 2014-12-13 17:31:09Z khmarbaise $
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CONTEXT_ROOT_FIELD
private java.lang.String
contextRoot
private static java.lang.String
WEB_MODULE
private static java.lang.String
WEB_URI_FIELD
-
Fields inherited from class org.apache.maven.plugin.ear.AbstractEarModule
ALT_DD, altDeploymentDescriptor, bundleDir, bundleFileName, earExecutionContext, excluded, JAVA_MODULE, MODULE_ELEMENT, unpack
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendModule(org.codehaus.plexus.util.xml.XMLWriter writer, java.lang.String version, java.lang.Boolean generateId)
Appends the XML representation of this module.java.lang.String
getContextRoot()
Returns the context root to use for the web module.private static java.lang.String
getDefaultContextRoot(org.apache.maven.artifact.Artifact a)
Generates a default context root for the given artifact, based on the artifactId.java.lang.String
getLibDir()
java.lang.String
getType()
Returns the type associated to the module.void
resolveArtifact(java.util.Set<org.apache.maven.artifact.Artifact> artifacts)
Resolves theArtifact
represented by the module.-
Methods inherited from class org.apache.maven.plugin.ear.AbstractEarModule
areNullOrEqual, changeManifestClasspath, cleanBundleDir, getAltDeploymentDescriptor, getArtifact, getArtifactId, getBundleDir, getBundleFileName, getClassifier, getGroupId, getModuleId, getOriginalBundleFileName, getUri, isExcluded, setEarExecutionContext, setUri, shouldUnpack, startModuleElement, toString, writeAltDeploymentDescriptor
-
-
-
-
Field Detail
-
WEB_MODULE
private static final java.lang.String WEB_MODULE
- See Also:
- Constant Field Values
-
WEB_URI_FIELD
private static final java.lang.String WEB_URI_FIELD
- See Also:
- Constant Field Values
-
CONTEXT_ROOT_FIELD
private static final java.lang.String CONTEXT_ROOT_FIELD
- See Also:
- Constant Field Values
-
contextRoot
private java.lang.String contextRoot
-
-
Method Detail
-
appendModule
public void appendModule(org.codehaus.plexus.util.xml.XMLWriter writer, java.lang.String version, java.lang.Boolean generateId)
Appends the XML representation of this module.- Parameters:
writer
- the writer to useversion
- the version of the application.xml filegenerateId
- whether an id should be generated
-
resolveArtifact
public void resolveArtifact(java.util.Set<org.apache.maven.artifact.Artifact> artifacts) throws EarPluginException, org.apache.maven.plugin.MojoFailureException
Resolves theArtifact
represented by the module. Note that theEarExecutionContext
might be used to customize further the resolution.- Specified by:
resolveArtifact
in interfaceEarModule
- Overrides:
resolveArtifact
in classAbstractEarModule
- Parameters:
artifacts
- the project's artifacts- Throws:
EarPluginException
- if the artifact could not be resolvedorg.apache.maven.plugin.MojoFailureException
- if an unexpected error occurred
-
getContextRoot
public java.lang.String getContextRoot()
Returns the context root to use for the web module. Note that this might return null till the artifact has been resolved.- Returns:
- the context root
-
getType
public java.lang.String getType()
Returns the type associated to the module.- Returns:
- the artifact's type of the module
-
getDefaultContextRoot
private static java.lang.String getDefaultContextRoot(org.apache.maven.artifact.Artifact a)
Generates a default context root for the given artifact, based on the artifactId.- Parameters:
a
- the artifact- Returns:
- a context root for the artifact
-
getLibDir
public java.lang.String getLibDir()
- Specified by:
getLibDir
in interfaceEarModule
- Overrides:
getLibDir
in classAbstractEarModule
- Returns:
- always
null
-
-