Class ManageDependencies

  • All Implemented Interfaces:
    MavenSourceVisitor<org.openrewrite.xml.tree.Xml>, org.openrewrite.RefactorVisitor<org.openrewrite.xml.tree.Xml>, org.openrewrite.SourceVisitor<org.openrewrite.xml.tree.Xml>, org.openrewrite.xml.XmlSourceVisitor<org.openrewrite.xml.tree.Xml>

    public class ManageDependencies
    extends MavenRefactorVisitor
    Make existing dependencies "dependency managed", moving the version to the dependencyManagement section of the POM.

    All dependencies that match groupPattern and artifactPattern should be align-able to the same version (either the version provided to this visitor or the maximum matching version if none is provided).

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isIdempotent()  
      void setArtifactPattern​(java.lang.String artifactPattern)  
      void setGroupPattern​(java.lang.String groupPattern)  
      void setVersion​(java.lang.String version)  
      org.openrewrite.Validated validate()  
      Maven visitMaven​(Maven maven)  
      org.openrewrite.xml.tree.Xml visitTag​(org.openrewrite.xml.tree.Xml.Tag tag)  
      • Methods inherited from class org.openrewrite.xml.XmlRefactorVisitor

        enclosingRootTag, enclosingTag, visitAttribute, visitCharData, visitComment, visitDocTypeDecl, visitElement, visitIdent, visitProcessingInstruction, visitProlog
      • Methods inherited from class org.openrewrite.AbstractRefactorVisitor

        andThen, andThen, next, refactor, refactor, refactor
      • Methods inherited from class org.openrewrite.AbstractSourceVisitor

        getCursor, setCursoringOn, visit, visitAfter, visitAfter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.openrewrite.RefactorVisitor

        defaultTo, generate, nextCycle
      • Methods inherited from interface org.openrewrite.SourceVisitor

        getCursor, getName, getTags, reduce, visit, visit, visitTree
      • Methods inherited from interface org.openrewrite.xml.XmlSourceVisitor

        enclosingTag, visitAttribute, visitCharData, visitComment, visitDocTypeDecl, visitElement, visitIdent, visitProcessingInstruction, visitProlog
    • Constructor Detail

      • ManageDependencies

        public ManageDependencies()
    • Method Detail

      • setGroupPattern

        public void setGroupPattern​(@Nullable
                                    java.lang.String groupPattern)
      • setArtifactPattern

        public void setArtifactPattern​(@Nullable
                                       java.lang.String artifactPattern)
      • setVersion

        public void setVersion​(@Nullable
                               java.lang.String version)
      • validate

        public org.openrewrite.Validated validate()
      • isIdempotent

        public boolean isIdempotent()
      • visitTag

        public org.openrewrite.xml.tree.Xml visitTag​(org.openrewrite.xml.tree.Xml.Tag tag)
        Specified by:
        visitTag in interface org.openrewrite.xml.XmlSourceVisitor<org.openrewrite.xml.tree.Xml>
        Overrides:
        visitTag in class org.openrewrite.xml.XmlRefactorVisitor