Package org.apache.maven.buildcache
Class CacheUtils
- java.lang.Object
-
- org.apache.maven.buildcache.CacheUtils
-
public class CacheUtils extends Object
Cache Utils
-
-
Constructor Summary
Constructors Constructor Description CacheUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
debugPrintCollection(org.slf4j.Logger logger, Collection<T> values, String heading, String elementCaption)
static <T> T
getLast(List<T> list)
static Path
getMultimoduleRoot(org.apache.maven.execution.MavenSession session)
static <T> T
getOrCreate(org.apache.maven.execution.MavenSession session, Object key, Supplier<T> supplier)
static boolean
isArchive(File file)
static boolean
isPom(org.apache.maven.model.Dependency dependency)
static boolean
isPom(org.apache.maven.project.MavenProject project)
static boolean
isSnapshot(String version)
static String
mojoExecutionKey(org.apache.maven.plugin.MojoExecution mojo)
static String
normalizedName(org.apache.maven.artifact.Artifact artifact)
static Scm
readGitInfo(org.apache.maven.execution.MavenSession session)
static void
unzip(Path zip, Path out)
static boolean
zip(Path dir, Path zip, String glob)
Put every matching files of a directory in a zip.
-
-
-
Method Detail
-
isPom
public static boolean isPom(org.apache.maven.project.MavenProject project)
-
isPom
public static boolean isPom(org.apache.maven.model.Dependency dependency)
-
isSnapshot
public static boolean isSnapshot(String version)
-
normalizedName
public static String normalizedName(org.apache.maven.artifact.Artifact artifact)
-
mojoExecutionKey
public static String mojoExecutionKey(org.apache.maven.plugin.MojoExecution mojo)
-
getMultimoduleRoot
public static Path getMultimoduleRoot(org.apache.maven.execution.MavenSession session)
-
readGitInfo
public static Scm readGitInfo(org.apache.maven.execution.MavenSession session) throws IOException
- Throws:
IOException
-
getLast
public static <T> T getLast(List<T> list)
-
getOrCreate
public static <T> T getOrCreate(org.apache.maven.execution.MavenSession session, Object key, Supplier<T> supplier)
-
isArchive
public static boolean isArchive(File file)
-
zip
public static boolean zip(Path dir, Path zip, String glob) throws IOException
Put every matching files of a directory in a zip.- Parameters:
dir
- directory to zipzip
- zip to populateglob
- glob to apply to filenames- Returns:
- true if at least one file has been included in the zip.
- Throws:
IOException
-
unzip
public static void unzip(Path zip, Path out) throws IOException
- Throws:
IOException
-
debugPrintCollection
public static <T> void debugPrintCollection(org.slf4j.Logger logger, Collection<T> values, String heading, String elementCaption)
-
-