Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumps deps to latest versions #279

Merged
merged 10 commits into from
Feb 16, 2025
Merged

bumps deps to latest versions #279

merged 10 commits into from
Feb 16, 2025

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Feb 15, 2025

This updates all versions to latest we can, with normal project constraints. Doing it a somewhat hard, but interesting way because hey, it's a weekend, so why not?!

I used goose to update to the latest versions with the following prompt, and provider: google model: gemini-2.0-flash with developer and github extensions enabled, as well as maven-mcp-server

Update all dependency and plugin versions to latest in all pom.xml files, including child modules and bom, including those set with properties whose name end in ".version".

Here are the rules:
* If the latest version includes a word like beta, alpha or rc, use the latest version that doesn't.
* Do not update any versions for this project's groupId
* If a version value begins and ends in '@', it is set by a property with a name equal to the text between the '@' characters.
* If a dependency sets version by property, update the property value, don't expand it.
* If there is a comment above its definition, honor any constraint it might have. Do not update versions with a TODO comment
* If the version property name contains digits before ".version", do not upgrade past that major version. For example, the "spring5.version" means update to the latest version of spring 5.x.x.
* If the version property name starts with "floor-", update to the latest patch version, but not to the next minor or major.

Rules when making file modifications
* keep the same indentation, formatting as the original files
* Do not change the order of properties you affect

Once complete, test your change by running `./mvnw clean install -DskipTests`.

Why didn't I just use openrewrite? well I did start with that, ./mvnw org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.activeRecipes=org.openrewrite.maven.UpgradePluginVersion, but it crashed cc @timtebeek

recipe stack trace ``` [WARNING] The recipe produced 237 warning(s). Please report this to the recipe author. [WARNING] Run with `--debug` or `-Drewrite.exportDatatables=true` to see all warnings. java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null at java.util.regex.Matcher.getTextLength (Matcher.java:1769) at java.util.regex.Matcher.reset (Matcher.java:415) at java.util.regex.Matcher. (Matcher.java:252) at java.util.regex.Pattern.matcher (Pattern.java:1134) at org.openrewrite.semver.HyphenRange.build (HyphenRange.java:47) at org.openrewrite.semver.Semver.validate (Semver.java:64) at org.openrewrite.maven.UpgradePluginVersion.getVisitor (UpgradePluginVersion.java:120) at org.openrewrite.scheduling.RecipeRunCycle.lambda$editSources$7 (RecipeRunCycle.java:178) at org.openrewrite.scheduling.RecipeStack.reduce (RecipeStack.java:57) at org.openrewrite.scheduling.RecipeRunCycle.lambda$editSources$8 (RecipeRunCycle.java:155) at org.openrewrite.internal.InMemoryLargeSourceSet.lambda$edit$0 (InMemoryLargeSourceSet.java:66) at org.openrewrite.internal.ListUtils.map (ListUtils.java:243) at org.openrewrite.internal.ListUtils.map (ListUtils.java:266) at org.openrewrite.internal.InMemoryLargeSourceSet.edit (InMemoryLargeSourceSet.java:65) at org.openrewrite.scheduling.RecipeRunCycle.editSources (RecipeRunCycle.java:154) at org.openrewrite.RecipeScheduler.runRecipeCycles (RecipeScheduler.java:87) at org.openrewrite.RecipeScheduler.scheduleRun (RecipeScheduler.java:41) at org.openrewrite.Recipe.run (Recipe.java:378) at org.openrewrite.Recipe.run (Recipe.java:374) at org.openrewrite.Recipe.run (Recipe.java:370) at org.openrewrite.maven.AbstractRewriteBaseRunMojo.runRecipe (AbstractRewriteBaseRunMojo.java:243) at org.openrewrite.maven.AbstractRewriteBaseRunMojo.listResults (AbstractRewriteBaseRunMojo.java:154) at org.openrewrite.maven.AbstractRewriteRunMojo.execute (AbstractRewriteRunMojo.java:66) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283) at org.apache.maven.cli.MavenCli.main (MavenCli.java:206) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52) at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161) at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73) ```

I then decided to destroy several hours trying to do something similar with an LLM ;)

@@ -204,6 +204,13 @@
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<!-- route slf4j 2 over log4j2 during integration tests -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodePrometheus fyi I added this to kill the warning in the integration test for pulsar. unrelated I know but too lazy to make a separate PR for such a nit.

@codefromthecrypt
Copy link
Member Author

seems I forgot to tell goose to use JDK 11 😊

@codefromthecrypt
Copy link
Member Author

free library update to anyone that fixes the JDK 11 build fail, I suspect we need a comment above some dep saying we can't update it while we still need to compile this project for java 6 (hence need JDK 11)

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt
Copy link
Member Author

nm guessed and it was errorprone, then maven-bundle-plugin

pom.xml Outdated Show resolved Hide resolved
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt
Copy link
Member Author

updated my prompt and also the version property name convention to match brave and also be more clear about bump rules. It managed to find more and update them this time.

@jkschneider
Copy link

Here is the way to build the OpenRewrite recipes correctly: https://youtu.be/HbyZsXz5Owo

image

@codefromthecrypt
Copy link
Member Author

thanks @jkschneider! yeah I should have been clear that doing it this way was mostly to practice prompt writing and it could have just as well been a task completely unrelated to maven. 💯 openrewrite is the right tool for this job.

@codefromthecrypt
Copy link
Member Author

ps will hold this open until brave is released, for further polishing. once this is released then we can do zipkin

Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt
Copy link
Member Author

fyi https://github.com/Bigsy/maven-mcp-server fixed the bug overnight, so it finds latest version properly. I just added a commit after re-running the prompt

@reta
Copy link
Contributor

reta commented Feb 16, 2025

ps will hold this open until brave is released, for further polishing. once this is released then we can do zipkin

6.1.0 is out

@codefromthecrypt
Copy link
Member Author

Great i will bump this with brave 6.1.0 when back home unless you beat me to it.

Signed-off-by: Adrian Cole <[email protected]>
@codefromthecrypt codefromthecrypt merged commit 300dd7e into master Feb 16, 2025
4 checks passed
@codefromthecrypt codefromthecrypt deleted the bumps branch February 16, 2025 06:27
@codefromthecrypt
Copy link
Member Author

cutting 3.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants