public abstract class AbstractEnvironmentsMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected String |
excludeEnvironments
Comma separated list of names of environments.
|
protected org.apache.maven.shared.filtering.MavenResourcesFiltering |
mavenResourcesFiltering |
Constructor and Description |
---|
AbstractEnvironmentsMojo() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.maven.archiver.MavenArchiveConfiguration |
addEnvironmentToManifest(org.apache.maven.archiver.MavenArchiveConfiguration archive,
String environment) |
protected File |
createArchiveFile(File unpackDirectory,
File targetDirectory,
String directory,
String archiveExt) |
protected void |
createLoggingOutput(String[] identifiedEnvironments) |
protected File |
createPluginResourceOutput() |
protected File |
createUnpackDirectory()
Create the unpack directory for later unpacking of the main artifact.
|
protected void |
deleteDirectoryOfPreviousRunIfExist(File directoryOfPreviousRun) |
protected List<String> |
environmentNamesAreValid(String[] environmens)
This will check if an environment (directory) contains a space cause the
environment will later being used as a classifier which does not allow a
space.
|
protected void |
filterResources(File outputDir,
String environment,
boolean singleEnvironment,
boolean ignoreTargetPath) |
protected void |
filterResourcesToAdditionalDirectories(String[] identifiedEnvironments) |
protected void |
filterResourcesToTarget(String[] identifiedEnvironments) |
org.apache.maven.archiver.MavenArchiveConfiguration |
getArchive(String environment) |
protected String |
getArchiveExtensionOfTheArtifact(org.apache.maven.artifact.Artifact artifact) |
protected String |
getArchiveExtensionOfTheProjectMainArtifact() |
protected File |
getArchiveFile(File basedir,
String finalName,
String classifier,
String archiveExt)
Returns the archive file to generate, based on an optional classifier.
|
List<EnvironmentArchiveConfiguration> |
getArchives() |
protected String |
getCommonDir() |
LinkedHashSet<String> |
getDelimiters() |
String |
getEncoding() |
String |
getEscapeString() |
String |
getExcludeEnvironments() |
List<String> |
getFilters() |
String |
getFinalName() |
protected abstract org.codehaus.plexus.archiver.jar.JarArchiver |
getJarArchiver() |
org.apache.maven.project.MavenProject |
getMavenProject() |
org.apache.maven.execution.MavenSession |
getMavenSession() |
List<String> |
getNonFilteredFileExtensions() |
File |
getOutputDirectory() |
org.apache.maven.project.MavenProjectHelper |
getProjectHelper() |
File |
getSourceDirectory() |
String |
getTargetPath() |
protected String |
getTargetPath(boolean singleEnvironment,
String environment) |
protected String[] |
getTheEnvironments(File resourceResult) |
boolean |
isEscapeWindowsPaths() |
boolean |
isFileNameFiltering() |
boolean |
isIncludeEmptyDirs() |
boolean |
isSupportMultiLineFiltering() |
boolean |
isUseDefaultDelimiters() |
void |
setExcludeEnvironments(String excludeEnvironments) |
void |
setIncludeEmptyDirs(boolean includeEmptyDirs) |
protected boolean |
shouldSkip(String environment)
Returns true if this directory in src/main/environments doesn't represent
an environment.
|
protected void |
validateEnvironments(String[] identifiedEnvironments)
This will validate the environments and will fail the build in case of
errors.
|
getLog, getPluginContext, setLog, setPluginContext
@Parameter(defaultValue="", name="excludeEnvironments", required=false) protected String excludeEnvironments
@Component(role=org.apache.maven.shared.filtering.MavenResourcesFiltering.class, hint="default") protected org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
public List<EnvironmentArchiveConfiguration> getArchives()
public org.apache.maven.archiver.MavenArchiveConfiguration getArchive(String environment)
protected org.apache.maven.archiver.MavenArchiveConfiguration addEnvironmentToManifest(org.apache.maven.archiver.MavenArchiveConfiguration archive, String environment)
public org.apache.maven.project.MavenProject getMavenProject()
public org.apache.maven.execution.MavenSession getMavenSession()
public File getOutputDirectory()
public org.apache.maven.project.MavenProjectHelper getProjectHelper()
public File getSourceDirectory()
public String getFinalName()
public String getEncoding()
protected String[] getTheEnvironments(File resourceResult)
resourceResult
- The directory where to search for different
environments.protected List<String> environmentNamesAreValid(String[] environmens)
environmens
- The environments which should be checked.empty
all environments are ok.protected File getArchiveFile(File basedir, String finalName, String classifier, String archiveExt)
basedir
- the output directoryfinalName
- the name of the ear fileclassifier
- an optional classifierarchiveExt
- Archive Extensionpublic String getEscapeString()
public boolean isEscapeWindowsPaths()
public boolean isFileNameFiltering()
public LinkedHashSet<String> getDelimiters()
public boolean isUseDefaultDelimiters()
public boolean isSupportMultiLineFiltering()
public String getExcludeEnvironments()
public void setExcludeEnvironments(String excludeEnvironments)
protected void deleteDirectoryOfPreviousRunIfExist(File directoryOfPreviousRun) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected File createUnpackDirectory() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
- in case of failures.org.apache.maven.plugin.MojoExecutionException
- in case of failures.protected String getArchiveExtensionOfTheProjectMainArtifact() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected String getArchiveExtensionOfTheArtifact(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected File createPluginResourceOutput() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public boolean isIncludeEmptyDirs()
public void setIncludeEmptyDirs(boolean includeEmptyDirs)
protected void filterResources(File outputDir, String environment, boolean singleEnvironment, boolean ignoreTargetPath) throws org.apache.maven.plugin.MojoExecutionException
outputDir
- Output Directory where the resources need to be copied.environment
- absolute path of the environment directory.singleEnvironment
- boolean that specifies the user specified em.env command line switch.org.apache.maven.plugin.MojoExecutionException
- in case of failures.protected void filterResourcesToTarget(String[] identifiedEnvironments) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void filterResourcesToAdditionalDirectories(String[] identifiedEnvironments) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected boolean shouldSkip(String environment)
environment
- name of the environment.protected void createLoggingOutput(String[] identifiedEnvironments)
protected void validateEnvironments(String[] identifiedEnvironments) throws org.apache.maven.plugin.MojoFailureException
identifiedEnvironments
- The environments which will be checked.org.apache.maven.plugin.MojoFailureException
- in case of invalid environments.protected File createArchiveFile(File unpackDirectory, File targetDirectory, String directory, String archiveExt) throws org.codehaus.plexus.archiver.manager.NoSuchArchiverException, IOException, org.apache.maven.plugin.MojoExecutionException
org.codehaus.plexus.archiver.manager.NoSuchArchiverException
IOException
org.apache.maven.plugin.MojoExecutionException
protected String getCommonDir()
public String getTargetPath()
protected abstract org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
Copyright © 2019. All rights reserved.