Class CleaningUnpackMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo
org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo
de.iip_ecosphere.platform.tools.maven.dependencies.CleaningUnpackMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
UnpackPluginMojo
@Mojo(name="unpack",
defaultPhase=PROCESS_SOURCES,
requiresProject=false,
threadSafe=true)
public class CleaningUnpackMojo
extends org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo
Extended unpack Mojo.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.maven.shared.model.fileset.FileSetA specificfileSetrule to select files and directories.private booleanprivate booleanprivate Stringprivate Fileprivate booleanprivate Fileprivate booleanFields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
outputAbsoluteArtifactFilename, reactorProjects, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected org.apache.maven.plugin.logging.LogReturns the cleanup log.getInitiallyAllowed(String initiallyAllowed, File initiallyAllowedFile, org.apache.maven.plugin.logging.Log log) Returns the initially allowed files/wildcards.private booleanReturns whether there is a setup for initially allowed files, consideringinitiallyAllowedFileandinitiallyAllowed.static booleanmatches(File file, Collection<String> allowed) Returns whetherfilematches at least one of the file names/wildcards inallowed.voidsetCleanup(org.apache.maven.shared.model.fileset.FileSet cleanup) Sets the file set to clean up.voidsetForce(boolean force) Sets the force flag.voidsetForceCleanup(boolean forceCleanup) Sets the forceCleanup flag.voidsetLogCleanup(boolean logCleanup) Sets whether the cleanup shall be logged.voidsetSkipIfExists(File skipIfExists) Sets the file/folder determining whether we can skip the execution if it exists.Returns the file/folder determining whether we can skip the execution if it exists.Methods inherited from class org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo
getExcludes, getFileMappers, getIncludes, getMarkersDirectory, getProcessedArtifactItems, setExcludes, setFileMappers, setIncludes, setMarkersDirectoryMethods inherited from class org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo
getArtifact, getArtifactItems, getOutputDirectory, getProcessedArtifactItems, isOverWriteIfNewer, isOverWriteReleases, isOverWriteSnapshots, setArtifact, setArtifactItems, setLocalRepositoryDirectory, setOutputDirectory, setOverWriteIfNewer, setOverWriteReleases, setOverWriteSnapshots, verifyRequirementsMethods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
copyFile, execute, getArchiverManager, getProject, isSilent, isSkip, isUseJvmChmod, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setArchiverManager, setSilent, setSkip, setUseJvmChmod, unpack, unpack, unpackMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
cleanup
@Parameter(required=false) private org.apache.maven.shared.model.fileset.FileSet cleanupA specificfileSetrule to select files and directories. -
initiallyAllowed
@Parameter(property="unpack.initiallyAllowed", required=false, defaultValue="") private String initiallyAllowed -
initiallyAllowedFile
@Parameter(property="unpack.initiallyAllowedFile", required=false, defaultValue="") private File initiallyAllowedFile -
force
@Parameter(property="unpack.force", required=false, defaultValue="false") private boolean force -
forceCleanup
@Parameter(property="unpack.forceCleanup", required=false, defaultValue="false") private boolean forceCleanup -
skipIfExists
@Parameter(property="unpack.skipIfExists", required=false, defaultValue="") private File skipIfExists -
skipIfNotFound
@Parameter(property="unpack.skipIfNotFound", required=false, defaultValue="false") private boolean skipIfNotFound -
logCleanup
@Parameter(property="unpack.logCleanup", required=false, defaultValue="false") private boolean logCleanup
-
-
Constructor Details
-
CleaningUnpackMojo
public CleaningUnpackMojo()
-
-
Method Details
-
hasInitiallyAllowed
private boolean hasInitiallyAllowed()Returns whether there is a setup for initially allowed files, consideringinitiallyAllowedFileandinitiallyAllowed.- Returns:
trueif there is some setup,falseelse
-
getInitiallyAllowed
public static Set<String> getInitiallyAllowed(String initiallyAllowed, File initiallyAllowedFile, org.apache.maven.plugin.logging.Log log) Returns the initially allowed files/wildcards. [public/static for testing]- Parameters:
initiallyAllowed- colon or semicolon separated list of filenames/wildcards, may be nullinitiallyAllowedFile- file with line separated list of filenames/wildcards, may be nulllog- maven plugin logging instance- Returns:
- the initially allowed files
-
matches
Returns whetherfilematches at least one of the file names/wildcards inallowed.- Parameters:
file- the file to match (including path)allowed- the allowed file names/wildcards- Returns:
truefor match,falsefor no match
-
getCleanupLog
protected org.apache.maven.plugin.logging.Log getCleanupLog()Returns the cleanup log.- Returns:
- the cleanup log, may be null for none
-
doExecute
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Overrides:
doExecutein classorg.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
setForceCleanup
public void setForceCleanup(boolean forceCleanup) Sets the forceCleanup flag.- Parameters:
forceCleanup- enable enforce cleanup
-
setSkipIfExists
Sets the file/folder determining whether we can skip the execution if it exists.- Parameters:
skipIfExists- the file/folder to consider
-
skipIfExists
Returns the file/folder determining whether we can skip the execution if it exists.- Returns:
- the file/folder
-
setLogCleanup
public void setLogCleanup(boolean logCleanup) Sets whether the cleanup shall be logged.- Parameters:
logCleanup- log the cleanup or not
-
setForce
public void setForce(boolean force) Sets the force flag.- Parameters:
force- execute forcibly
-