openrewrite / rewrite

Automated mass refactoring of source code.
https://docs.openrewrite.org
Apache License 2.0
2.3k stars 341 forks source link

Upgrade maven dependency dropping versions #2219

Closed jkschneider closed 2 years ago

jkschneider commented 2 years ago

Problem

Why were some versions deleted?

Example diff

          <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>3.7.7</version>
             <scope>test</scope>
         </dependency>
           <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-module-junit4</artifactId>
-            <version>2.0.9</version>
             <scope>test</scope>
         </dependency>
           <dependency>
             <groupId>io.jenkins.plugins</groupId>
             <artifactId>plugin-util-api</artifactId>
-            <version>2.0.0</version>
         </dependency>

         <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
           <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
-            <version>2.12.0</version>
+            <version>2.12.7</version>
         </dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
-            <version>2.12.0</version>
+            <version>2.12.7</version>
         </dependency>
         <dependency>
             <groupId>io.jenkins.configuration-as-code</groupId>

Recipes in example diff:

jkschneider commented 2 years ago

Is this because of RemoveRedundantDependencyVersions? If so, please close.

tkvangorder commented 2 years ago

Yep, those dependencies have managed versions (from the parent).