Class CleanMvnArtifacts

java.lang.Object
de.oktoflow.platform.cmdTools.CleanMvnArtifacts

public class CleanMvnArtifacts extends Object
Cleans up maven artifacts according to their version/snapshot in a working directory or a repository.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static long
     
    private static long
     
    private static boolean
     
    private static de.iip_ecosphere.platform.support.Version
     
    private static de.iip_ecosphere.platform.support.Version
     
    private static boolean
     
    private static boolean
     
    private static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    Recursively cleans up a Maven repository starting at file.
    private static void
    cleanTarget(File targetFolder)
    Cleans up the given workspace targetFolder.
    private static void
    Recursively cleans up artifacts in target folders in a workspace starting at file.
    private static void
    delete(File file)
    Deletes a file/folder and counts the deleted number of files/bytes.
    private static boolean
    isInVersionRange(de.iip_ecosphere.platform.support.Version version)
    Returns whether the given version is in the version range of minVer and maxVer.
    static void
    main(String[] args)
    Cleans up maven artifacts according to their version/snapshot in a working directory or a repository.
    private static de.iip_ecosphere.platform.support.Version
    toVersion(String text, boolean ignoreException)
    Turns text to a version.

    Methods inherited from class java.lang.Object

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

    • SNAPSHOT_SUFFIX

      private static final String SNAPSHOT_SUFFIX
      See Also:
    • minVer

      private static de.iip_ecosphere.platform.support.Version minVer
    • maxVer

      private static de.iip_ecosphere.platform.support.Version maxVer
    • includeReleases

      private static boolean includeReleases
    • onRepo

      private static boolean onRepo
    • simulate

      private static boolean simulate
    • cleanupCount

      private static long cleanupCount
    • cleanupSize

      private static long cleanupSize
  • Constructor Details

    • CleanMvnArtifacts

      public CleanMvnArtifacts()
  • Method Details

    • main

      public static void main(String[] args)
      Cleans up maven artifacts according to their version/snapshot in a working directory or a repository.
      Parameters:
      args - the command line arguments
    • toVersion

      private static de.iip_ecosphere.platform.support.Version toVersion(String text, boolean ignoreException)
      Turns text to a version.
      Parameters:
      text - the text, may be null
      ignoreException - shall failures be ignored or shall the message be emitted and the JVM be terminated
      Returns:
      the version or null
    • cleanRepo

      private static void cleanRepo(File file)
      Recursively cleans up a Maven repository starting at file.
      Parameters:
      file - the file/folder to clean up
    • cleanTargets

      private static void cleanTargets(File file)
      Recursively cleans up artifacts in target folders in a workspace starting at file.
      Parameters:
      file - the file/folder to clean up
    • cleanTarget

      private static void cleanTarget(File targetFolder)
      Cleans up the given workspace targetFolder.
      Parameters:
      targetFolder - the target folder
    • isInVersionRange

      private static boolean isInVersionRange(de.iip_ecosphere.platform.support.Version version)
      Returns whether the given version is in the version range of minVer and maxVer.
      Parameters:
      version - the version to check, may be null (will never be in any range)
      Returns:
      true if version is in the version range, false else
    • delete

      private static void delete(File file)
      Deletes a file/folder and counts the deleted number of files/bytes.
      Parameters:
      file - the file to delete