Package de.oktoflow.platform.cmdTools
Class CleanMvnArtifacts
java.lang.Object
de.oktoflow.platform.cmdTools.CleanMvnArtifacts
Cleans up maven artifacts according to their version/snapshot in a working directory or a repository.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static longprivate static longprivate static booleanprivate static de.iip_ecosphere.platform.support.Versionprivate static de.iip_ecosphere.platform.support.Versionprivate static booleanprivate static booleanprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidRecursively cleans up a Maven repository starting atfile.private static voidcleanTarget(File targetFolder) Cleans up the given workspacetargetFolder.private static voidcleanTargets(File file) Recursively cleans up artifacts in target folders in a workspace starting atfile.private static voidDeletes a file/folder and counts the deleted number of files/bytes.private static booleanisInVersionRange(de.iip_ecosphere.platform.support.Version version) static voidCleans up maven artifacts according to their version/snapshot in a working directory or a repository.private static de.iip_ecosphere.platform.support.VersionTurnstextto a version.
-
Field Details
-
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
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) Turnstextto a version.- Parameters:
text- the text, may be nullignoreException- shall failures be ignored or shall the message be emitted and the JVM be terminated- Returns:
- the version or null
-
cleanRepo
Recursively cleans up a Maven repository starting atfile.- Parameters:
file- the file/folder to clean up
-
cleanTargets
Recursively cleans up artifacts in target folders in a workspace starting atfile.- Parameters:
file- the file/folder to clean up
-
cleanTarget
Cleans up the given workspacetargetFolder.- Parameters:
targetFolder- the target folder
-
isInVersionRange
private static boolean isInVersionRange(de.iip_ecosphere.platform.support.Version version) - Parameters:
version- the version to check, may be null (will never be in any range)- Returns:
trueifversionis in the version range,falseelse
-
delete
Deletes a file/folder and counts the deleted number of files/bytes.- Parameters:
file- the file to delete
-