Class DetermineRemoteRepositories

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

public class DetermineRemoteRepositories extends Object
Determines the used remote Maven repositories. If multiple were used for download, prefer "central".
Author:
Holger Eichelberger, SSE
  • Constructor Details

    • DetermineRemoteRepositories

      public DetermineRemoteRepositories()
  • Method Details

    • main

      public static void main(String[] args)
      The main program.
      Parameters:
      args - the command line arguments, may be optional Maven arguments (such as -o, the last one optional the POM file to analyze (else pom.xml)
    • getEffectiveDependencies

      private static List<String> getEffectiveDependencies(String[] args) throws IOException, InterruptedException
      Executes 'mvn dependency:list' using ProcessBuilder. Parses the output to find unique G:A:V:S coordinates.
      Parameters:
      args - the command line arguments, may be optional Maven arguments (such as -o, the last one optional the POM file to analyze (else pom.xml)
      Throws:
      IOException
      InterruptedException
    • resolveOriginFromLocalFiles

      private static String resolveOriginFromLocalFiles(String coords, String localRepoBase)
      Navigates the .m2 folder structure and parses repository metadata files.
      Parameters:
      coords - the maven coordinates
      localRepoBase - the base directory of the local repository