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 StringThe alt-dd module.protected StringThe alternate deployment descriptor.protected StringThe bundleDir.protected StringThe bundleFileName.protected booleanIf module is considered for inclusion into the Class-Path entry of MANIFEST.mf of other modules.protected EarExecutionContextprotected Booleanexcluded by defaultfalse.protected static final StringThe java module.protected StringDirectory of module which contains libraries packaged into module.protected static final StringThe module element.protected StringThe type of the artifactprotected Booleanunpack -
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 TypeMethodDescriptionbooleanThe 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.ArtifactReturns theArtifactrepresenting 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 theURIfor this module.booleanIf module should be included into the Class-Path entry of MANIFEST.mf.booleanSpecify whether this module should be excluded or not.voidresolveArtifact(Set<org.apache.maven.artifact.Artifact> artifacts) Resolves theArtifactrepresented by the module.voidsetEarExecutionContext(EarExecutionContext earExecutionContext) Specify whether this module should be unpacked in the EAR archive or not.protected voidstartModuleElement(org.codehaus.plexus.util.xml.XMLWriter writer, Boolean generateId) Starts a newMODULE_ELEMENTon the specified writer, possibly including an id attribute.toString()protected voidwriteAltDeploymentDescriptor(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, waitMethods 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.nullvalue 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.falsevalue leads to removal of the module from the Class-Path entry.truevalue 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:
setEarExecutionContextin 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 theArtifactrepresented by the module. Note that theEarExecutionContextmight be used to customize further the resolution.- Specified by:
resolveArtifactin 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:EarModuleReturns theArtifactrepresenting this module. Note that this might returnnulltill the module has been resolved.- Specified by:
getArtifactin interfaceEarModule- Returns:
artifact- See Also:
-
getModuleId
- Returns:
moduleId
-
getUri
Description copied from interface:EarModuleReturns theURIfor 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:
isClassPathItemin 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:
getBundleFileNamein 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:
getAltDeploymentDescriptorin interfaceEarModule- Returns:
- the alternative deployment descriptor for this module
-
isExcluded
public boolean isExcluded()Specify whether this module should be excluded or not.- Specified by:
isExcludedin interfaceEarModule- Returns:
- true if this module should be skipped, false otherwise
-
shouldUnpack
Description copied from interface:EarModuleSpecify 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:
shouldUnpackin 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_ELEMENTon 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:
changeManifestClasspathin interfaceEarModule- Returns:
- always
true
-