Maven update dependencies in POM

前端 未结 5 1505
深忆病人
深忆病人 2020-12-07 15:34

Are there any preexisting Maven plugins or commands to update the dependencies in the POM? Example: (if this was in my POM)



        
5条回答
  •  猫巷女王i
    2020-12-07 15:58

    Personally, I think there should be an additional parameter in maven that would allow you to add to the pom.xml.

    See post at http://maven.40175.n5.nabble.com/Is-there-any-maven-plugin-to-add-dependency-to-existing-pom-xml-td2839092.html#a5772853

    Here, you can add the following to your pom.xml file:

    
      ...
      
        ...
        
          ...
          
            org.codehaus.mojo
            versions-maven-plugin
            2.1
          
          ...
        
        ...
      
      ...
    
    

    ...

    Then backup your pom.xml file via version set command:

    mvn versions:set -DnewVersion=9.9.9
    

    Run latest versions:

    mvn versions:use-latest-versions
    

    and diff the pom.xml files, pom.xml and pom.xml.versionsBackup

提交回复
热议问题