Class PomHelper
java.lang.Object
org.technologybrewery.baton.util.pom.PomHelper
Generalized static utilities for assisting with altering Maven POM files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.maven.model.ModelHelper function to construct a Model of a pom file.static org.apache.maven.model.InputLocationincrementColumn(org.apache.maven.model.InputLocation location, int columnIndexShift) Shifts the given column index for a given InputLocation type by a given amount.static booleanwriteModifications(File file, PomModifications.Final modifications) Writes a finalized set of modifications back to a pom file.
-
Method Details
-
getLocationAnnotatedModel
Helper function to construct a Model of a pom file.- Parameters:
file- File object representing a pom file.- Returns:
- the constructed Model.
-
writeModifications
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
-