@Mojo(name="ear",
defaultPhase=PACKAGE,
threadSafe=true,
requiresDependencyResolution=TEST)
public class EarMojo
extends AbstractEarMojo
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
applicationXml
The location of a custom application.xml file to be used within the EAR file.
|
private org.apache.maven.archiver.MavenArchiveConfiguration |
archive
The archive configuration to use.
|
private org.codehaus.plexus.archiver.manager.ArchiverManager |
archiverManager
The archive manager.
|
private java.lang.String |
classifier
Classifier to add to the artifact generated.
|
private boolean |
duplicateArtifactsBreakTheBuild
The list of artifacts is checked and if you set this to
true the build will fail if duplicate artifacts
have been found within the build configuration. |
private java.io.File |
earSourceDirectory
Single directory for extra files to include in the EAR.
|
private java.lang.String |
earSourceExcludes
The comma separated list of tokens to exclude from the EAR.
|
private java.lang.String |
earSourceIncludes
The comma separated list of tokens to include in the EAR.
|
private boolean |
escapedBackslashesInFilePath
To escape interpolated value with Windows path c:\foo\bar will be replaced with c:\\foo\\bar.
|
protected java.lang.String |
escapeString
Expression preceded with this String won't be interpolated \${foo} will be replaced with ${foo}.
|
private boolean |
filtering
Specify that the EAR sources should be filtered.
|
private java.util.List<java.lang.String> |
filters
Filters (property files) to include during the interpolation of the pom.xml.
|
private java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> |
filterWrappers |
private java.lang.String |
finalName
The name of the EAR file to generate.
|
private org.codehaus.plexus.archiver.jar.JarArchiver |
jarArchiver
The Jar archiver.
|
private java.io.File |
manifestFile
The location of the manifest file to be used within the EAR file.
|
private org.apache.maven.shared.filtering.MavenFileFilter |
mavenFileFilter |
private org.apache.maven.shared.filtering.MavenResourcesFiltering |
mavenResourcesFiltering |
private java.util.List<java.lang.String> |
nonFilteredFileExtensions
A list of file extensions that should not be filtered if filtering is enabled.
|
private java.lang.String |
outputDirectory
The directory for the generated EAR.
|
private java.lang.String |
packagingExcludes
A comma separated list of tokens to exclude when packaging the EAR.
|
private java.lang.String |
packagingIncludes
A comma separated list of tokens to include when packaging the EAR.
|
private org.apache.maven.project.MavenProjectHelper |
projectHelper |
private org.apache.maven.execution.MavenSession |
session |
private boolean |
skinnyWars
Whether to create skinny WARs or not.
|
private boolean |
skipClassPathModification
In case of using the
skinnyWars and AbstractEarMojo.defaultLibBundleDir usually the
classpath will be modified. |
private java.lang.String |
unpackTypes
The comma separated list of artifact's type(s) to unpack by default.
|
private boolean |
useJvmChmod |
private org.codehaus.plexus.archiver.zip.ZipArchiver |
zipArchiver
The Zip archiver.
|
private org.codehaus.plexus.archiver.zip.ZipUnArchiver |
zipUnArchiver
The Zip Un archiver.
|
APPLICATION_XML_URI, artifactTypeMappings, defaultLibBundleDir, encoding, generatedDescriptorLocation, META_INF, project, UTF_8, version| Constructor and Description |
|---|
EarMojo() |
| Modifier and Type | Method and Description |
|---|---|
private static java.io.File |
buildDestinationFile(java.io.File buildDir,
java.lang.String uri) |
private void |
changeManifestClasspath(EarModule module,
java.io.File original,
JavaEEVersion javaEEVersion) |
private void |
checkModuleUniqueness() |
private void |
copyFile(java.io.File source,
java.io.File target) |
private void |
copyModules(JavaEEVersion javaEEVersion,
java.util.List<java.lang.String> unpackTypesList) |
private java.util.List<java.lang.String> |
createUnpackList() |
void |
execute() |
java.lang.String |
getApplicationXml() |
private static java.io.File |
getEarFile(java.lang.String basedir,
java.lang.String finalName,
java.lang.String classifier)
Returns the EAR file to generate, based on an optional classifier.
|
private java.lang.String[] |
getEarFiles(java.io.File sourceDir)
Returns a list of filenames that should be copied over to the destination directory.
|
protected java.lang.String[] |
getExcludes()
Returns a string array of the excludes to be used when assembling/copying the ear.
|
private java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> |
getFilterWrappers() |
protected java.lang.String[] |
getIncludes()
Returns a string array of the includes to be used when assembling/copying the ear.
|
protected org.codehaus.plexus.archiver.jar.JarArchiver |
getJarArchiver()
Returns the
JarArchiver implementation used to package the EAR file. |
java.lang.String[] |
getPackagingExcludes() |
java.lang.String[] |
getPackagingIncludes() |
private void |
includeCustomManifestFile() |
boolean |
isNonFilteredExtension(java.lang.String fileName) |
void |
setApplicationXml(java.lang.String applicationXml) |
void |
setPackagingExcludes(java.lang.String packagingExcludes) |
void |
setPackagingIncludes(java.lang.String packagingIncludes) |
void |
unpack(java.io.File source,
java.io.File destDir)
Unpacks the module into the EAR structure.
|
getJbossConfiguration, getModules, getProject, getTempFolder, getWorkDirectory@Parameter(defaultValue="${basedir}/src/main/application",
required=true)
private java.io.File earSourceDirectory
@Parameter(alias="includes",
defaultValue="**")
private java.lang.String earSourceIncludes
@Parameter(alias="excludes") private java.lang.String earSourceExcludes
@Parameter(defaultValue="false") private boolean filtering
@Parameter private java.util.List<java.lang.String> filters
@Parameter private java.util.List<java.lang.String> nonFilteredFileExtensions
@Parameter(property="maven.ear.escapedBackslashesInFilePath",
defaultValue="false")
private boolean escapedBackslashesInFilePath
@Parameter(property="maven.ear.escapeString") protected java.lang.String escapeString
@Parameter(defaultValue="false") private boolean skipClassPathModification
skinnyWars and AbstractEarMojo.defaultLibBundleDir usually the
classpath will be modified.
By settings this option true you can change this and keep the classpath untouched.
This option has been introduced to keep the backward compatibility with earlier versions
of the plugin.@Parameter private java.io.File manifestFile
@Parameter private java.lang.String applicationXml
@Parameter(defaultValue="${project.build.directory}",
required=true)
private java.lang.String outputDirectory
@Parameter(alias="earName",
defaultValue="${project.build.finalName}",
required=true)
private java.lang.String finalName
@Parameter private java.lang.String unpackTypes
@Parameter private java.lang.String classifier
@Parameter private java.lang.String packagingExcludes
@Parameter private java.lang.String packagingIncludes
@Parameter(property="maven.ear.skinnyWars",
defaultValue="false")
private boolean skinnyWars
@Component(role=org.codehaus.plexus.archiver.Archiver.class,
hint="jar")
private org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
@Component(role=org.codehaus.plexus.archiver.Archiver.class,
hint="zip")
private org.codehaus.plexus.archiver.zip.ZipArchiver zipArchiver
@Component(role=org.codehaus.plexus.archiver.UnArchiver.class,
hint="zip")
private org.codehaus.plexus.archiver.zip.ZipUnArchiver zipUnArchiver
@Parameter private org.apache.maven.archiver.MavenArchiveConfiguration archive
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
@Component(role=org.apache.maven.shared.filtering.MavenFileFilter.class,
hint="default")
private org.apache.maven.shared.filtering.MavenFileFilter mavenFileFilter
@Component(role=org.apache.maven.shared.filtering.MavenResourcesFiltering.class,
hint="default")
private org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
@Parameter(defaultValue="${session}",
readonly=true,
required=true)
private org.apache.maven.execution.MavenSession session
private java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers
@Parameter(property="maven.ear.useJvmChmod",
defaultValue="true")
private boolean useJvmChmod
@Parameter(defaultValue="false",
property="maven.ear.duplicateArtifactsBreakTheBuild")
private boolean duplicateArtifactsBreakTheBuild
true the build will fail if duplicate artifacts
have been found within the build configuration.private void checkModuleUniqueness()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class AbstractEarMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate void copyModules(JavaEEVersion javaEEVersion, java.util.List<java.lang.String> unpackTypesList) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate java.util.List<java.lang.String> createUnpackList()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic java.lang.String getApplicationXml()
applicationXmlpublic void setApplicationXml(java.lang.String applicationXml)
applicationXml - applicationXmlprotected java.lang.String[] getExcludes()
protected java.lang.String[] getIncludes()
public java.lang.String[] getPackagingExcludes()
public void setPackagingExcludes(java.lang.String packagingExcludes)
packagingExcludes - packagingExcludespublic java.lang.String[] getPackagingIncludes()
public void setPackagingIncludes(java.lang.String packagingIncludes)
packagingIncludes - packagingIncludesprivate static java.io.File buildDestinationFile(java.io.File buildDir,
java.lang.String uri)
private void includeCustomManifestFile()
private static java.io.File getEarFile(java.lang.String basedir,
java.lang.String finalName,
java.lang.String classifier)
basedir - the output directoryfinalName - the name of the ear fileclassifier - an optional classifierprivate java.lang.String[] getEarFiles(java.io.File sourceDir)
sourceDir - the directory to be scannedpublic void unpack(java.io.File source,
java.io.File destDir)
throws org.codehaus.plexus.archiver.manager.NoSuchArchiverException,
java.io.IOException
source - File to be unpacked.destDir - Location where to put the unpacked files.org.codehaus.plexus.archiver.manager.NoSuchArchiverException - In case of we don't have an appropriate archiver.java.io.IOException - In case of a general IOException.protected org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
JarArchiver implementation used to package the EAR file.
By default the archiver is obtained from the Plexus container.private void copyFile(java.io.File source,
java.io.File target)
throws org.apache.maven.shared.filtering.MavenFilteringException,
java.io.IOException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.shared.filtering.MavenFilteringExceptionjava.io.IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionpublic boolean isNonFilteredExtension(java.lang.String fileName)
fileName - The name of the file which should be checked.true if the name is part of the non filtered extensions false otherwise.private java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> getFilterWrappers()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void changeManifestClasspath(EarModule module, java.io.File original, JavaEEVersion javaEEVersion) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException