Class CacheUtils


  • public class CacheUtils
    extends Object
    Cache Utils
    • Constructor Detail

      • CacheUtils

        public CacheUtils()
    • 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 zip
        zip - zip to populate
        glob - glob to apply to filenames
        Returns:
        true if at least one file has been included in the zip.
        Throws:
        IOException
      • debugPrintCollection

        public static <T> void debugPrintCollection​(org.slf4j.Logger logger,
                                                    Collection<T> values,
                                                    String heading,
                                                    String elementCaption)