operaton / migrate-from-camunda-recipe

An Open Rewrite Recipe to migrate a Camunda 7 Instance to Operaton
https://www.operaton.org
4 stars 1 forks source link

Update the version even if it is located in a Maven Property #13

Open javahippie opened 2 weeks ago

javahippie commented 2 weeks ago

Is your feature request related to a problem? Please describe. Many projects define dependency versions in project properties like this:

<project>
               <groupId>org.operaton.test</groupId>
               <artifactId>test-app</artifactId>
               <version>1</version>
               <properties>
                 <camunda.version>7.22.0</camunda.version>
               </properties>
               <dependencies>
                 <dependency>
                   <groupId>org.camunda.bpm</groupId>
                   <artifactId>camunda-engine</artifactId>
                   <version>${camunda.version}</version>
                 </dependency>
               </dependencies>
           </project>

Currently the OpenRewrite script can not handle this case and is not able to upgrade this version.

MBoegers commented 2 weeks ago

'can not handle' is not 100% correct. I see a requirement to not update the properties, as this maybe break the build by upgrading another dependency unexpectedly. This would violate the "Do no harm" policy of OpenRewrite ;)

There is a work round that needs a small custom recipe, I think this could be of great value for all.

  1. replace the property with the fixed version for all camunda GAVs that are now covered by operaton (new recipe, but beneficial if contributed to rewrite/rewrite-maven)
  2. migrate the version via org.openrewrite.maven.UpgradeDependencyVersion
javahippie commented 2 weeks ago

Thanks for your input (also on the other tickets!), that's really valuable