Class MavenUtils

java.lang.Object
io.jmix.flowui.devserver.MavenUtils

public class MavenUtils extends Object
Utilities for Maven based projects.
  • Method Details

    • parsePomFileFromFolder

      public static Document parsePomFileFromFolder(File projectFolder)
      Parses the pom file in the given folder.
      Parameters:
      projectFolder - the project folder
      Returns:
      a parsed pom.xml if pom.xml exists or null if no pom.xml was found or it could not be parsed
    • parsePomFile

      public static Document parsePomFile(File pomFile)
      Parses the given pom file.
      Parameters:
      pomFile - the pom file
      Returns:
      a parsed pom.xml if the pom.xml file exists or null if no pom.xml was found or it could not be parsed
    • getGroupId

      public static String getGroupId(Document pom)
      Finds the group id for the given pom file.
      Parameters:
      pom - the parsed pom.xml
      Returns:
      the groupId from the pom file
    • getArtifactId

      public static String getArtifactId(Document pom)
      Finds the artifact id for the given pom file.
      Parameters:
      pom - the parsed pom.xml
      Returns:
      the artifactId from the pom file
    • getParentPomOfMultiModuleProject

      public static File getParentPomOfMultiModuleProject(File pomFile)
      Gets the parent pom location for the given pom file, if the given pom file is part of a multi module project.
      Parameters:
      pomFile - the pom file
      Returns:
      the location of the parent pom file or null if the given pom file does not have a parent inside the same multi module project
    • getModuleFolders

      public static List<String> getModuleFolders(Document pom)
      Gets a list of the folders containing the sub modules for the given pom file.
      Parameters:
      pom - the pom file containing sub modules
      Returns:
      a list of folders for the sub modules