spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
870 stars 203 forks source link

[refactoring] converting petclinic to Spring Boot 3 results in broken project #864

Closed martinlippert closed 1 year ago

martinlippert commented 1 year ago

Converting the standard petclinic sample application to Spring Boot 3 results in a broken project:

    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
    </dependency>

so that compile errors are the result.

BoykoAlex commented 1 year ago

I thought Rewrite wanted to get this fixed... probably still isn't

martinlippert commented 1 year ago

Here are the things that the Spring Boot Migrator project includes at the moment with regards to converting projects to use Spring Boot 3: https://github.com/spring-projects-experimental/spring-boot-migrator/blob/main/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-2.7-3.0-dependency-version-update.yaml

So it looks to me like we should have our own, custom-made Spring Tools 4 recipe that contains the things from rewrite-spring (that we use at the moment) and pick additional open-rewrite-based things from the SBM yaml mentioned above, and use that (for the moment) to offer users the ability to convert Spring Boot projects to Spring Boot 3.

Over time, those things should converge - and moved back to rewrite-spring - but in the short-term, having a custom recipe to aggregate the pieces makes some sense to me.

BoykoAlex commented 1 year ago

Should be fixed once this is merged: https://github.com/openrewrite/rewrite-migrate-java/pull/144

BoykoAlex commented 1 year ago

@martinlippert shall we perhaps switch to rewrite snapshots for now? Less stability I suppose but always on the latest Rewrite code with the latest fixes and additions?

martinlippert commented 1 year ago

@BoykoAlex Yes, we should switch to snapshot versions. In addition to that I am thinking the situation where a new Spring Boot (patch) version is being published. It seems to me like the recipe needs to always update to the latest Spring Boot 3.0.x version (instead of having a fixed one in the recipe). But we should probably have that in a separate issue.

BoykoAlex commented 1 year ago

Should be fixed. Rewrite is fixed and rewrite snapshots consumed by sts4.