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

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.maven.shared.model.fileset.FileSet
    A specific fileSet rule to select files and directories.
    private boolean
     
    private boolean
     
    private String
     
    private File
     
    private boolean
     
    private File
     

    Fields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo

    outputAbsoluteArtifactFilename, reactorProjects, session

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected org.apache.maven.plugin.logging.Log
    Returns the cleanup log.
    static Set<String>
    getInitiallyAllowed(String initiallyAllowed, File initiallyAllowedFile, org.apache.maven.plugin.logging.Log log)
    Returns the initially allowed files/wildcards.
    private boolean
    Returns whether there is a setup for initially allowed files, considering initiallyAllowedFile and initiallyAllowed.
    static boolean
    matches(File file, Collection<String> allowed)
    Returns whether file matches at least one of the file names/wildcards in allowed.
    void
    setCleanup(org.apache.maven.shared.model.fileset.FileSet cleanup)
    Sets the file set to clean up.
    void
    setForce(boolean force)
    Sets the force flag.
    void
    setForceCleanup(boolean forceCleanup)
    Sets the forceCleanup flag.
    void
    setLogCleanup(boolean logCleanup)
    Sets whether the cleanup shall be logged.
    void
    setSkipIfExists(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, setMarkersDirectory

    Methods inherited from class org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo

    getArtifact, getArtifactItems, getOutputDirectory, getProcessedArtifactItems, isOverWriteIfNewer, isOverWriteReleases, isOverWriteSnapshots, setArtifact, setArtifactItems, setLocalRepositoryDirectory, setOutputDirectory, setOverWriteIfNewer, setOverWriteReleases, setOverWriteSnapshots, verifyRequirements

    Methods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo

    copyFile, execute, getArchiverManager, getProject, isSilent, isSkip, isUseJvmChmod, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setArchiverManager, setSilent, setSkip, setUseJvmChmod, unpack, unpack, unpack

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • cleanup

      @Parameter(required=false) private org.apache.maven.shared.model.fileset.FileSet cleanup
      A specific fileSet rule 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
    • 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, considering initiallyAllowedFile and initiallyAllowed.
      Returns:
      true if there is some setup, false else
    • 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 null
      initiallyAllowedFile - file with line separated list of filenames/wildcards, may be null
      log - maven plugin logging instance
      Returns:
      the initially allowed files
    • matches

      public static boolean matches(File file, Collection<String> allowed)
      Returns whether file matches at least one of the file names/wildcards in allowed.
      Parameters:
      file - the file to match (including path)
      allowed - the allowed file names/wildcards
      Returns:
      true for match, false for 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:
      doExecute in class org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • setForceCleanup

      public void setForceCleanup(boolean forceCleanup)
      Sets the forceCleanup flag.
      Parameters:
      forceCleanup - enable enforce cleanup
    • setCleanup

      public void setCleanup(org.apache.maven.shared.model.fileset.FileSet cleanup)
      Sets the file set to clean up.
      Parameters:
      cleanup - the file set
    • setSkipIfExists

      public void setSkipIfExists(File skipIfExists)
      Sets the file/folder determining whether we can skip the execution if it exists.
      Parameters:
      skipIfExists - the file/folder to consider
    • skipIfExists

      public File 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