Class AbstractEarMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    EarMojo, GenerateApplicationXmlMojo

    public abstract class AbstractEarMojo
    extends org.apache.maven.plugin.AbstractMojo
    A base class for EAR-processing related tasks.
    Version:
    $Id: AbstractEarMojo.java 1648051 2014-12-27 12:55:58Z khmarbaise $
    • Field Detail

      • APPLICATION_XML_URI

        public static final java.lang.String APPLICATION_XML_URI
        The application XML URI META-INF/application.xml
        See Also:
        Constant Field Values
      • META_INF

        public static final java.lang.String META_INF
        The META-INF folder.
        See Also:
        Constant Field Values
      • UTF_8

        public static final java.lang.String UTF_8
        UTF-8 encoding constant.
        See Also:
        Constant Field Values
      • version

        @Parameter(defaultValue="1.3")
        protected java.lang.String version
        The version of the application.xml to generate. Valid values are 1.3, 1.4, 5, 6 and 7.
      • encoding

        @Parameter(defaultValue="UTF-8")
        protected java.lang.String encoding
        Character encoding for the auto-generated deployment file(s).
      • generatedDescriptorLocation

        @Parameter(defaultValue="${project.build.directory}")
        protected java.lang.String generatedDescriptorLocation
        Directory where the deployment descriptor file(s) will be auto-generated.
      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        protected org.apache.maven.project.MavenProject project
        The maven project.
      • modules

        @Parameter
        private EarModule[] modules
        The ear modules configuration.
      • artifactTypeMappings

        @Parameter
        protected org.codehaus.plexus.configuration.PlexusConfiguration artifactTypeMappings
        The artifact type mappings.
      • defaultLibBundleDir

        @Parameter
        protected java.lang.String defaultLibBundleDir
        The default bundle dir for libraries.
      • includeLibInApplicationXml

        @Parameter(defaultValue="false")
        private java.lang.Boolean includeLibInApplicationXml
        Should libraries be added in application.xml
      • fileNameMapping

        @Parameter
        private java.lang.String fileNameMapping
        The file name mapping to use for all dependencies included in the EAR file. The following values are valid standard, {code no-version}, full, no-version-for-ejb. The standard means the filename is the artifactId incl. the version of the artifact. The no-version means the files is only the artifactId without the version. The full means the filename is the groupId+artifactId+version of the artifact. The no-version-for-ejb means the filename is the artifactId without the version in case of EJB type.
      • useBaseVersion

        @Parameter
        private java.lang.Boolean useBaseVersion
        When using a fileNameMapping with versions, either use the baseVersion or the version. When the artifact is a SNAPSHOT, version will always return a value with a -SNAPSHOT postfix instead of the possible timestamped value.
        Since:
        2.9
      • workDirectory

        @Parameter(defaultValue="${project.build.directory}/${project.build.finalName}",
                   required=true)
        private java.io.File workDirectory
        Directory that resources are copied to during the build.
      • jboss

        @Parameter
        private org.codehaus.plexus.configuration.PlexusConfiguration jboss
        The JBoss specific configuration.
      • mainArtifactId

        @Parameter
        private java.lang.String mainArtifactId
        The id to use to define the main artifact (e.g. the artifact without a classifier) when there is multiple candidates.
      • tempFolder

        @Parameter(defaultValue="${project.build.directory}",
                   required=true)
        private java.io.File tempFolder
        temp folder location.
      • mavenResourcesFiltering

        @Component
        private org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
      • earModules

        private java.util.List<EarModule> earModules
      • allModules

        private java.util.List<EarModule> allModules
    • Constructor Detail

      • AbstractEarMojo

        public AbstractEarMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • getModules

        protected java.util.List<EarModule> getModules()
        Returns:
        The list of earModules.
      • getProject

        protected org.apache.maven.project.MavenProject getProject()
        Returns:
        MavenProject
      • getWorkDirectory

        protected java.io.File getWorkDirectory()
        Returns:
        workDirectory
      • getTempFolder

        public java.io.File getTempFolder()
        Returns:
        tempFolder
      • isArtifactRegistered

        private static boolean isArtifactRegistered​(org.apache.maven.artifact.Artifact a,
                                                    java.util.List<EarModule> currentList)
      • initializeJbossConfiguration

        private void initializeJbossConfiguration()
                                           throws EarPluginException
        Initializes the JBoss configuration.
        Throws:
        EarPluginException - if the configuration is invalid