Package org.apache.maven.plugin.ear
Class GenerateApplicationXmlMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugin.ear.AbstractEarMojo
-
- org.apache.maven.plugin.ear.GenerateApplicationXmlMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate-application-xml", defaultPhase=GENERATE_RESOURCES, threadSafe=true, requiresDependencyResolution=TEST) public class GenerateApplicationXmlMojo extends AbstractEarMojo
Generates the EAR deployment descriptor file(s).- Version:
- $Id: GenerateApplicationXmlMojo.java 1648055 2014-12-27 14:59:45Z khmarbaise $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
applicationId
Defines the application id used when generating the deployment descriptor.private java.lang.String
applicationName
Application name of the application to be used when the application.xml file is auto-generated.static java.lang.String
DEFAULT
The DEFAULT library folder.private java.lang.String
description
Description of the application to be used when the application.xml file is auto-generated.private java.lang.String
displayName
Display name of the application to be used when the application.xml file is auto-generated.private org.codehaus.plexus.configuration.PlexusConfiguration
ejbRefs
Theejb-ref
entries.static java.lang.String
EMPTY
The empty folder.private org.codehaus.plexus.configuration.PlexusConfiguration
envEntries
The env-entries to be added to the auto-generated application.xml file.private java.lang.Boolean
generateApplicationXml
Whether the application.xml should be generated or not.private java.lang.Boolean
generateModuleId
Whether a module ID should be generated if none is specified.private java.lang.Boolean
initializeInOrder
Defines the value of the initialize in order element to be used when the application.xml file is auto-generated.private java.lang.String
libraryDirectoryMode
Defines how the library-directory element should be written in the application.xml file.static java.lang.String
NONE
The NONE not existent folder.private org.codehaus.plexus.configuration.PlexusConfiguration
security
The security-roles to be added to the auto-generated application.xml file.-
Fields inherited from class org.apache.maven.plugin.ear.AbstractEarMojo
APPLICATION_XML_URI, artifactTypeMappings, defaultLibBundleDir, encoding, generatedDescriptorLocation, META_INF, project, UTF_8, version
-
-
Constructor Summary
Constructors Constructor Description GenerateApplicationXmlMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List<EjbRef>
buildEjbEntries()
Builds the ejb-ref based on the configuration.private java.util.List<EnvEntry>
buildEnvEntries()
Builds the env-entries based on the configuration.private java.util.List<SecurityRole>
buildSecurityRoles()
Builds the security roles based on the configuration.void
execute()
protected void
generateJbossDeploymentDescriptor()
Generates the jboss deployment descriptor.protected void
generateStandardDeploymentDescriptor(JavaEEVersion javaEEVersion)
Generates the deployment descriptor.private java.lang.String
getActualLibraryDirectory()
Returns the value to use for the library-directory element, based on the library directory mode.private java.lang.String
interpolate(org.codehaus.plexus.interpolation.Interpolator interpolator, java.lang.String element)
This help method was needed otherwise the interpolate method of interpolator will make an empty string of anull
element which results in supplemental elements for env-entry.-
Methods inherited from class org.apache.maven.plugin.ear.AbstractEarMojo
getJbossConfiguration, getModules, getProject, getTempFolder, getWorkDirectory
-
-
-
-
Field Detail
-
DEFAULT
public static final java.lang.String DEFAULT
The DEFAULT library folder.- See Also:
- Constant Field Values
-
EMPTY
public static final java.lang.String EMPTY
The empty folder.- See Also:
- Constant Field Values
-
NONE
public static final java.lang.String NONE
The NONE not existent folder.- See Also:
- Constant Field Values
-
generateApplicationXml
@Parameter(defaultValue="true") private java.lang.Boolean generateApplicationXml
Whether the application.xml should be generated or not.
-
generateModuleId
@Parameter(defaultValue="false") private java.lang.Boolean generateModuleId
Whether a module ID should be generated if none is specified.
-
applicationName
@Parameter private java.lang.String applicationName
Application name of the application to be used when the application.xml file is auto-generated. Since JavaEE6.
-
displayName
@Parameter(defaultValue="${project.artifactId}") private java.lang.String displayName
Display name of the application to be used when the application.xml file is auto-generated.
-
description
@Parameter(defaultValue="${project.description}") private java.lang.String description
Description of the application to be used when the application.xml file is auto-generated.
-
libraryDirectoryMode
@Parameter(defaultValue="DEFAULT") private java.lang.String libraryDirectoryMode
Defines how the library-directory element should be written in the application.xml file. Three special values can be set:DEFAULT
(default) generates a library-directory element with the value of the defaultLibBundleDir parameterEMPTY
generates an empty library-directory element. Per spec, this disables the scanning of jar files in the lib directory of the ear fileNONE
does not write the library-directory element at all. A corner case that can be used in Oracle Weblogic to delegate the classloading to the container
-
initializeInOrder
@Parameter private java.lang.Boolean initializeInOrder
Defines the value of the initialize in order element to be used when the application.xml file is auto-generated. When set to true, modules must be initialized in the order they're listed in this deployment descriptor, with the exception of application client modules, which can be initialized in any order. If initialize-in-order is not set or set to false, the order of initialization is unspecified and may be product-dependent. Since JavaEE6.
-
applicationId
@Parameter private java.lang.String applicationId
Defines the application id used when generating the deployment descriptor.- Since:
- 2.9
-
security
@Parameter private org.codehaus.plexus.configuration.PlexusConfiguration security
The security-roles to be added to the auto-generated application.xml file.
-
envEntries
@Parameter(alias="env-entries") private org.codehaus.plexus.configuration.PlexusConfiguration envEntries
The env-entries to be added to the auto-generated application.xml file. Since JavaEE6.
-
ejbRefs
@Parameter(alias="ejb-refs") private org.codehaus.plexus.configuration.PlexusConfiguration ejbRefs
Theejb-ref
entries.
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractEarMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
generateStandardDeploymentDescriptor
protected void generateStandardDeploymentDescriptor(JavaEEVersion javaEEVersion) throws EarPluginException
Generates the deployment descriptor.- Parameters:
javaEEVersion
-JavaEEVersion
- Throws:
EarPluginException
- if the configuration is invalid
-
generateJbossDeploymentDescriptor
protected void generateJbossDeploymentDescriptor() throws EarPluginException
Generates the jboss deployment descriptor.- Throws:
EarPluginException
- if the configuration is invalid
-
buildSecurityRoles
private java.util.List<SecurityRole> buildSecurityRoles() throws EarPluginException
Builds the security roles based on the configuration.- Returns:
- a list of SecurityRole object(s)
- Throws:
EarPluginException
- if the configuration is invalid
-
interpolate
private java.lang.String interpolate(org.codehaus.plexus.interpolation.Interpolator interpolator, java.lang.String element) throws org.codehaus.plexus.interpolation.InterpolationException
This help method was needed otherwise the interpolate method of interpolator will make an empty string of anull
element which results in supplemental elements for env-entry.- Parameters:
interpolator
- The interpolatorelement
- The element- Returns:
- The interpolated elements.
- Throws:
org.codehaus.plexus.interpolation.InterpolationException
- in case of an error.
-
buildEnvEntries
private java.util.List<EnvEntry> buildEnvEntries() throws EarPluginException
Builds the env-entries based on the configuration.- Returns:
- a list of EnvEntry object(s)
- Throws:
EarPluginException
- if the configuration is invalid
-
buildEjbEntries
private java.util.List<EjbRef> buildEjbEntries() throws EarPluginException
Builds the ejb-ref based on the configuration.- Returns:
- a list of EjbRef object(s)
- Throws:
EarPluginException
- if the configuration is invalid
-
getActualLibraryDirectory
private java.lang.String getActualLibraryDirectory() throws EarPluginException
Returns the value to use for the library-directory element, based on the library directory mode.- Throws:
EarPluginException
-
-