Class POMOperator

java.lang.Object
io.codemodder.plugins.maven.operator.POMOperator

public class POMOperator extends Object
Facade for the POM Operator, providing methods for modifying and querying POM files.
  • Constructor Details

    • POMOperator

      public POMOperator(Path pomFile, Path projectDir)
  • Method Details

    • getPomScanner

      public io.codemodder.plugins.maven.operator.POMScanner getPomScanner()
    • addDependency

      public ProjectModel addDependency(io.codemodder.DependencyGAV newDependencyGAV) throws XMLStreamException, URISyntaxException, IOException, org.dom4j.DocumentException
      Modifies and retrieves the ProjectModel with a new dependency.
      Parameters:
      newDependencyGAV - The new DependencyGAV to add to the POM.
      Returns:
      The modified ProjectModel, or null if the modification was unsuccessful.
      Throws:
      XMLStreamException - If an error occurs during XML stream processing.
      URISyntaxException - If there is an issue with the URI syntax.
      IOException - If an I/O error occurs.
      org.dom4j.DocumentException - If an error occurs while parsing the document.
    • getAllFoundDependencies

      @NotNull public @NotNull Collection<io.codemodder.DependencyGAV> getAllFoundDependencies() throws org.dom4j.DocumentException, IOException, URISyntaxException, XMLStreamException
      Retrieves all found dependencies in the POM.
      Returns:
      A collection of DependencyGAV objects representing the found dependencies.
      Throws:
      org.dom4j.DocumentException - If an error occurs while parsing the document.
      IOException - If an I/O error occurs.
      URISyntaxException - If there is an issue with the URI syntax.
      XMLStreamException - If an error occurs during XML stream processing.