Class AbstractEarModule

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractEarModule()
      Empty 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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static boolean areNullOrEqual​(java.lang.Object first, java.lang.Object second)
      Specify if the objects are both null or both equal.
      boolean changeManifestClasspath()  
      (package private) static java.lang.String cleanBundleDir​(java.lang.String bundleDir)
      Cleans the bundle directory so that it might be used properly.
      java.lang.String 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.
      org.apache.maven.artifact.Artifact getArtifact()
      Returns the Artifact representing this module.
      java.lang.String getArtifactId()
      Returns the artifact's Id.
      java.lang.String getBundleDir()
      Returns the bundle directory.
      java.lang.String getBundleFileName()
      Returns the bundle file name.
      java.lang.String getClassifier()
      Returns the artifact's classifier.
      java.lang.String getGroupId()
      Returns the artifact's groupId.
      java.lang.String getLibDir()  
      java.lang.String getModuleId()  
      java.lang.String getOriginalBundleFileName()
      Based on MEAR-189 we need to get back the original file name under any circumstances.
      java.lang.String getUri()
      Returns the URI for this module.
      boolean isExcluded()
      Specify whether this module should be excluded or not.
      void resolveArtifact​(java.util.Set<org.apache.maven.artifact.Artifact> artifacts)
      Resolves the Artifact represented by the module.
      void setEarExecutionContext​(EarExecutionContext earExecutionContext)
      (package private) void setUri​(java.lang.String uri)
      Sets the URI of the module explicitly for testing purposes.
      java.lang.Boolean shouldUnpack()
      Specify whether this module should be unpacked in the EAR archive or not.
      protected void startModuleElement​(org.codehaus.plexus.util.xml.XMLWriter writer, java.lang.Boolean generateId)
      Starts a new MODULE_ELEMENT on the specified writer, possibly including an id attribute.
      java.lang.String toString()
      protected void writeAltDeploymentDescriptor​(org.codehaus.plexus.util.xml.XMLWriter writer, java.lang.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
    • Field Detail

      • MODULE_ELEMENT

        protected static final java.lang.String MODULE_ELEMENT
        The module element.
        See Also:
        Constant Field Values
      • JAVA_MODULE

        protected static final java.lang.String JAVA_MODULE
        The java module.
        See Also:
        Constant Field Values
      • ALT_DD

        protected static final java.lang.String ALT_DD
        The alt-dd module.
        See Also:
        Constant Field Values
      • artifact

        private org.apache.maven.artifact.Artifact artifact
      • groupId

        private java.lang.String groupId
      • artifactId

        private java.lang.String artifactId
      • classifier

        private java.lang.String classifier
      • bundleDir

        protected java.lang.String bundleDir
        The bundleDir.
      • bundleFileName

        protected java.lang.String bundleFileName
        The bundleFileName.
      • excluded

        protected java.lang.Boolean excluded
        excluded by default false.
      • uri

        private java.lang.String uri
      • unpack

        protected java.lang.Boolean unpack
        unpack
      • altDeploymentDescriptor

        protected java.lang.String altDeploymentDescriptor
        The alternate deployment descriptor.
      • moduleId

        private java.lang.String moduleId
    • Constructor Detail

      • 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 Detail

      • 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
        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
      • getModuleId

        public java.lang.String getModuleId()
        Returns:
        moduleId
      • getUri

        public java.lang.String getUri()
        Description copied from interface: EarModule
        Returns the URI for this module.
        Specified by:
        getUri in interface EarModule
        Returns:
        Return the URI.
      • getGroupId

        public java.lang.String getGroupId()
        Returns the artifact's groupId.
        Returns:
        groupId
      • getArtifactId

        public java.lang.String getArtifactId()
        Returns the artifact's Id.
        Returns:
        artifactId
      • getClassifier

        public java.lang.String getClassifier()
        Returns the artifact's classifier.
        Returns:
        the artifact classifier
      • getBundleDir

        public java.lang.String getBundleDir()
        Returns the bundle directory. If null, the module is bundled in the root of the EAR.
        Returns:
        the custom bundle directory
      • getBundleFileName

        public java.lang.String getBundleFileName()
        Returns the bundle file name. If null, the artifact's file name is returned.
        Returns:
        the bundle file name
      • getOriginalBundleFileName

        public java.lang.String getOriginalBundleFileName()
        Based on MEAR-189 we need to get back the original file name under any circumstances.
        Returns:
        The original file name.
      • getAltDeploymentDescriptor

        public java.lang.String 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 interface EarModule
        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 interface EarModule
        Returns:
        true if this module should be skipped, false otherwise
      • shouldUnpack

        public java.lang.Boolean 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 interface EarModule
        Returns:
        unpack
      • writeAltDeploymentDescriptor

        protected void writeAltDeploymentDescriptor​(org.codehaus.plexus.util.xml.XMLWriter writer,
                                                    java.lang.String version)
        Writes the alternative deployment descriptor if necessary.
        Parameters:
        writer - the writer to use
        version - the java EE version in use
      • startModuleElement

        protected void startModuleElement​(org.codehaus.plexus.util.xml.XMLWriter writer,
                                          java.lang.Boolean generateId)
        Starts a new MODULE_ELEMENT on the specified writer, possibly including an id attribute.
        Parameters:
        writer - the XML writer.
        generateId - whether an id should be generated
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • cleanBundleDir

        static java.lang.String cleanBundleDir​(java.lang.String bundleDir)
        Cleans the bundle directory so that it might be used properly.
        Parameters:
        bundleDir - the bundle directory to clean
        Returns:
        the cleaned bundle directory
      • areNullOrEqual

        static boolean areNullOrEqual​(java.lang.Object first,
                                      java.lang.Object second)
        Specify if the objects are both null or both equal.
        Parameters:
        first - the first object
        second - the second object
        Returns:
        true if parameters are either both null or equal
      • setUri

        void setUri​(java.lang.String uri)
        Sets the URI of the module explicitly for testing purposes.
        Parameters:
        uri - the uri
      • getLibDir

        public java.lang.String getLibDir()
        Specified by:
        getLibDir in interface EarModule
        Returns:
        always null