Class PomHelper

java.lang.Object
org.technologybrewery.baton.util.pom.PomHelper

public final class PomHelper extends Object
Generalized static utilities for assisting with altering Maven POM files.
  • Method Details

    • getLocationAnnotatedModel

      public static org.apache.maven.model.Model getLocationAnnotatedModel(File file)
      Helper function to construct a Model of a pom file.
      Parameters:
      file - File object representing a pom file.
      Returns:
      the constructed Model.
    • writeModifications

      public static boolean writeModifications(File file, PomModifications.Final modifications)
      Writes a finalized set of modifications back to a pom file.
      Parameters:
      file - The original pom file.
      modifications - Finalized set of modifications.
      Returns:
      true iff the write operation completes successfully.
    • incrementColumn

      public static org.apache.maven.model.InputLocation incrementColumn(org.apache.maven.model.InputLocation location, int columnIndexShift)
      Shifts the given column index for a given InputLocation type by a given amount.
      Parameters:
      location - the initial location to be updated with a new column index as a InputLocation.
      columnIndexShift - number of column indexes to move by represented as a signed integer.
      Returns:
      a new InputLocation type with an updated column index.
      See Also:
      • InputLocation