Package org.apache.maven.plugins.ear
Class AbstractEarModule
java.lang.Object
org.apache.maven.plugins.ear.AbstractEarModule
- All Implemented Interfaces:
EarModule
- Direct Known Subclasses:
AppClientModule
,EjbModule
,HarModule
,JarModule
,RarModule
,SarModule
,WebModule
A base implementation of an
EarModule
.- Author:
- Stephane Nicoll
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The alt-dd module.protected String
The alternate deployment descriptor.protected String
The bundleDir.protected String
The bundleFileName.protected boolean
If module is considered for inclusion into the Class-Path entry of MANIFEST.mf of other modules.protected EarExecutionContext
protected Boolean
excluded by defaultfalse
.protected static final String
The java module.protected String
Directory of module which contains libraries packaged into module.protected static final String
The module element.protected String
The type of the artifactprotected Boolean
unpack -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor to be used when the module is built based on the configuration.AbstractEarModule
(org.apache.maven.artifact.Artifact a) Creates an ear module from the artifact. -
Method Summary
Modifier and TypeMethodDescriptionboolean
The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular Java EE module.org.apache.maven.artifact.Artifact
Returns theArtifact
representing this module.Returns the artifact's Id.Returns the bundle directory.Returns the bundle file name.Returns the artifact's classifier.Returns the artifact's groupId.getType()
Returns the type associated to the module.getUri()
Returns theURI
for this module.boolean
If module should be included into the Class-Path entry of MANIFEST.mf.boolean
Specify whether this module should be excluded or not.void
resolveArtifact
(Set<org.apache.maven.artifact.Artifact> artifacts) Resolves theArtifact
represented by the module.void
setEarExecutionContext
(EarExecutionContext earExecutionContext) Specify whether this module should be unpacked in the EAR archive or not.protected void
startModuleElement
(org.codehaus.plexus.util.xml.XMLWriter writer, Boolean generateId) Starts a newMODULE_ELEMENT
on the specified writer, possibly including an id attribute.toString()
protected void
writeAltDeploymentDescriptor
(org.codehaus.plexus.util.xml.XMLWriter writer, String version) Writes the alternative deployment descriptor if necessary.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.maven.plugins.ear.EarModule
appendModule
-
Field Details
-
MODULE_ELEMENT
The module element.- See Also:
-
JAVA_MODULE
The java module.- See Also:
-
ALT_DD
The alt-dd module.- See Also:
-
type
The type of the artifact -
bundleDir
The bundleDir. -
bundleFileName
The bundleFileName. -
excluded
excluded by defaultfalse
. -
unpack
unpack -
altDeploymentDescriptor
The alternate deployment descriptor. -
libDirectory
Directory of module which contains libraries packaged into module.null
value means that module doesn't contain any library. Each module type can provide default value for this directory and this option can be used to override that default value. If module libraries are located at the root of module then use single slash (/) to configure that in POM. That is, a single slash is treated as an empty string. -
classPathItem
protected boolean classPathItemIf module is considered for inclusion into the Class-Path entry of MANIFEST.mf of other modules.false
value leads to removal of the module from the Class-Path entry.true
value leads to modification of the reference to the module in the Class-Path entry if such reference exists or leads to adding of the module into the Class-Path entry if such reference doesn't exist. Removal, modification or adding of the reference in the Class-Path entry depends on libDirectory property of another module and on skinnyWars / skinnyModules parameters of EAR Plugin. -
earExecutionContext
-
-
Constructor Details
-
AbstractEarModule
public AbstractEarModule()Empty constructor to be used when the module is built based on the configuration. -
AbstractEarModule
public AbstractEarModule(org.apache.maven.artifact.Artifact a) Creates an ear module from the artifact.- Parameters:
a
- the artifact
-
-
Method Details
-
setEarExecutionContext
- Specified by:
setEarExecutionContext
in interfaceEarModule
- Parameters:
earExecutionContext
- The execution context.
-
resolveArtifact
public void resolveArtifact(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
- Parameters:
artifacts
- the project's artifacts- Throws:
EarPluginException
- if the artifact could not be resolvedorg.apache.maven.plugin.MojoFailureException
- if an unexpected error occurred
-
getArtifact
public org.apache.maven.artifact.Artifact getArtifact()Description copied from interface:EarModule
Returns theArtifact
representing this module. Note that this might returnnull
till the module has been resolved.- Specified by:
getArtifact
in interfaceEarModule
- Returns:
artifact
- See Also:
-
getModuleId
- Returns:
moduleId
-
getUri
Description copied from interface:EarModule
Returns theURI
for this module. -
getType
Returns the type associated to the module. -
getGroupId
Returns the artifact's groupId.- Returns:
groupId
-
getArtifactId
Returns the artifact's Id.- Returns:
artifactId
-
getClassifier
Returns the artifact's classifier.- Returns:
- the artifact classifier
-
getBundleDir
Returns the bundle directory. If null, the module is bundled in the root of the EAR.- Returns:
- the custom bundle directory
-
getLibDir
-
isClassPathItem
public boolean isClassPathItem()If module should be included into the Class-Path entry of MANIFEST.mf. Doesn't impact Class-Path entry of MANIFEST.mf of modules which contain all of their dependencies unless skinnyWars / skinnyModules is turned on.- Specified by:
isClassPathItem
in interfaceEarModule
- Returns:
- True} if module should be included into the Class-Path entry of MANIFEST.mf
-
getBundleFileName
Returns the bundle file name. Ifnull
, the artifact's file name is returned.- Specified by:
getBundleFileName
in interfaceEarModule
- Returns:
- the bundle file name
-
getAltDeploymentDescriptor
The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular Java EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory.- Specified by:
getAltDeploymentDescriptor
in interfaceEarModule
- Returns:
- the alternative deployment descriptor for this module
-
isExcluded
public boolean isExcluded()Specify whether this module should be excluded or not.- Specified by:
isExcluded
in interfaceEarModule
- Returns:
- true if this module should be skipped, false otherwise
-
shouldUnpack
Description copied from interface:EarModule
Specify whether this module should be unpacked in the EAR archive or not. Returns null if no configuration was specified so that defaulting may apply.- Specified by:
shouldUnpack
in interfaceEarModule
- Returns:
unpack
-
writeAltDeploymentDescriptor
protected void writeAltDeploymentDescriptor(org.codehaus.plexus.util.xml.XMLWriter writer, String version) Writes the alternative deployment descriptor if necessary.- Parameters:
writer
- the writer to useversion
- the java EE version in use
-
startModuleElement
protected void startModuleElement(org.codehaus.plexus.util.xml.XMLWriter writer, Boolean generateId) Starts a newMODULE_ELEMENT
on the specified writer, possibly including an id attribute.- Parameters:
writer
- the XML writer.generateId
- whether an id should be generated
-
toString
-
changeManifestClasspath
public boolean changeManifestClasspath()- Specified by:
changeManifestClasspath
in interfaceEarModule
- Returns:
- always
true
-