Class WebModule

  • All Implemented Interfaces:
    EarModule

    public class WebModule
    extends AbstractEarModule
    The EarModule implementation for a Web application module.
    Version:
    $Id: WebModule.java 1645331 2014-12-13 17:31:09Z khmarbaise $
    • Field Detail

      • CONTEXT_ROOT_FIELD

        private static final java.lang.String CONTEXT_ROOT_FIELD
        See Also:
        Constant Field Values
      • contextRoot

        private java.lang.String contextRoot
    • Constructor Detail

      • WebModule

        public WebModule()
        Create an instance.
      • WebModule

        public WebModule​(org.apache.maven.artifact.Artifact a)
        Parameters:
        a - Artifact
    • 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 use
        version - the version of the application.xml file
        generateId - 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 the Artifact represented by the module. Note that the EarExecutionContext might be used to customize further the resolution.
        Specified by:
        resolveArtifact in interface EarModule
        Overrides:
        resolveArtifact in class AbstractEarModule
        Parameters:
        artifacts - the project's artifacts
        Throws:
        EarPluginException - if the artifact could not be resolved
        org.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