Package org.apache.maven.plugin.ear
Class AbstractEarMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugin.ear.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 Summary
Fields Modifier and Type Field Description private java.util.List<EarModule>
allModules
static java.lang.String
APPLICATION_XML_URI
The application XML URIMETA-INF/application.xml
protected org.codehaus.plexus.configuration.PlexusConfiguration
artifactTypeMappings
The artifact type mappings.protected java.lang.String
defaultLibBundleDir
The default bundle dir for libraries.private java.util.List<EarModule>
earModules
protected java.lang.String
encoding
Character encoding for the auto-generated deployment file(s).private java.lang.String
fileNameMapping
The file name mapping to use for all dependencies included in the EAR file.protected java.lang.String
generatedDescriptorLocation
Directory where the deployment descriptor file(s) will be auto-generated.private java.lang.Boolean
includeLibInApplicationXml
Should libraries be added in application.xmlprivate org.codehaus.plexus.configuration.PlexusConfiguration
jboss
The JBoss specific configuration.private JbossConfiguration
jbossConfiguration
private java.lang.String
mainArtifactId
The id to use to define the main artifact (e.g.private org.apache.maven.shared.filtering.MavenResourcesFiltering
mavenResourcesFiltering
static java.lang.String
META_INF
TheMETA-INF
folder.private EarModule[]
modules
The ear modules configuration.protected org.apache.maven.project.MavenProject
project
The maven project.private java.io.File
tempFolder
temp folder location.private java.lang.Boolean
useBaseVersion
static java.lang.String
UTF_8
UTF-8 encoding constant.protected java.lang.String
version
The version of the application.xml to generate.private java.io.File
workDirectory
Directory that resources are copied to during the build.
-
Constructor Summary
Constructors Constructor Description AbstractEarMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected JbossConfiguration
getJbossConfiguration()
protected java.util.List<EarModule>
getModules()
protected org.apache.maven.project.MavenProject
getProject()
java.io.File
getTempFolder()
protected java.io.File
getWorkDirectory()
private void
initializeJbossConfiguration()
Initializes the JBoss configuration.private static boolean
isArtifactRegistered(org.apache.maven.artifact.Artifact a, java.util.List<EarModule> currentList)
-
-
-
Field Detail
-
APPLICATION_XML_URI
public static final java.lang.String APPLICATION_XML_URI
The application XML URIMETA-INF/application.xml
- See Also:
- Constant Field Values
-
META_INF
public static final java.lang.String META_INF
TheMETA-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 validstandard
, {code no-version},full
,no-version-for-ejb
. Thestandard
means the filename is the artifactId incl. the version of the artifact. Theno-version
means the files is only the artifactId without the version. Thefull
means the filename is the groupId+artifactId+version of the artifact. Theno-version-for-ejb
means the filename is the artifactId without the version in case ofEJB
type.
-
useBaseVersion
@Parameter private java.lang.Boolean useBaseVersion
When using afileNameMapping
with versions, either use thebaseVersion
or theversion
. 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
-
jbossConfiguration
private JbossConfiguration jbossConfiguration
-
-
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
-
getJbossConfiguration
protected JbossConfiguration getJbossConfiguration()
- Returns:
jbossConfiguration
-
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
-
-