Closed ge0ffrey closed 1 year ago
@ge0ffrey
Thanks for reporting.
See the first warning in step 1:
You must run maven with a java 8 SDK.
We should consider moving away from Spring Petclinic as the example, since it requires the extra step of using JDK 8 which is becoming increasingly unlikely to be installed on a dev machine.
I'm also updating my write up here for Foojay, but keeping the Java 8 in there; with SDKMan instructions to make it easy to run multiple versions. That version also does not use the openrewrite/spring-petclinic, so might be more familiar to users.
Missed you at Devoxx @ge0ffrey ; were you looking to continue the demo you saw there perhaps? That one's here.
@timtebeek I heard good things about the devoxx talk, but missed it myself. I saw a good talk mention it on Thursday - this project looks wonderful! Happy to meet up sometime. I am based out of Gent.
I tried JDK 17 too, which runs into the same issue. As for requiring JDK 8 for the quickstart... that's... unsettling. Having sdkman already installed, it somehow feels very dirty to type "sdk install java 8.0.322-tem". No, I can't. It's almost Halloween. I got two rules around Halloween: Don't stay boogieman 3 times. And don't install a Java version older than Java 11. Too dangerous. Who knows what happens if we start writing such incantations?
This works like a charm on a newly generated quarkus project (and probably for new spring boot project too), with JDK 17:
./mvnw org.openrewrite.maven:rewrite-maven-plugin:4.36.0:run -Drewrite.activeRecipes=org.openrewrite.java.format.AutoFormat
@timtebeek I heard good things about the devoxx talk, but missed it myself. I saw a good talk mention it on Thursday - this project looks wonderful! Happy to meet up sometime. I am based out of Gent.
Cool yes Marit and I did some cross-promotion; good to hear you enjoyed hers as well. Would be fun to meet up again; it's been a while since our dinner at Devoxx Poland. Are you presenting at JavaLand early next year?
I tried JDK 17 too, which runs into the same issue. As for requiring JDK 8 for the quickstart... that's... unsettling. Having sdkman already installed, it somehow feels very dirty to type "sdk install java 8.0.322-tem". No, I can't. It's almost Halloween. I got two rules around Halloween: Don't stay boogieman 3 times. And don't install a Java version older than Java 11. Too dangerous. Who knows what happens if we start writing such incantations?
Understandable that you'd prefer 11+, but you can't run this 1.5.x branch of spring-projects/spring-petclinic without Java 8 at least temporarily. :) Luckily it's just two quick commands to switch to Spring Boot 2.7 & Java 17:
./mvnw org.openrewrite.maven:rewrite-maven-plugin:4.36.0:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:4.29.0 \
-DactiveRecipes=org.openrewrite.java.spring.boot2.SpringBoot1To2Migration
./mvnw org.openrewrite.maven:rewrite-maven-plugin:4.36.0:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:1.13.0 \
-DactiveRecipes=org.openrewrite.java.migrate.UpgradeJava17
That's the extremely short version of the quickstart & blogpost. And you can explore & run other recipes in the same way as well. We even have a few on Quarkus that I think you'll enjoy.
Thank you Tim :)
Quick update: The 1.5x branch has been updated to Java 11 with SpringBoot 2.1.x.
Hi @ge0ffrey, thank you for reporting the issue -- we've updated the getting started example of pet clinic to Java 11 using SpringBoot 2.1.x.
Does the change resolve your issue?
Closing the issue due to inactivity - pet clinic has been upgraded to SpringBoot 2.1.x with Java 11.
When I follow the quickstart https://docs.openrewrite.org/getting-started/getting-started and git clone https://github.com/openrewrite/spring-petclinic-migration.git
I run into two problems: