Skip to content

#159 Added action for Johnzon upgrade for Spring boot migration 2.7 t… #265

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

Merged
merged 5 commits into from
Aug 3, 2022

Conversation

ravig-kant
Copy link
Contributor

…o 3.x

@fabapp2 fabapp2 linked an issue Jul 28, 2022 that may be closed by this pull request
4 tasks
Copy link
Contributor

@fabapp2 fabapp2 left a comment

Choose a reason for hiding this comment

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

Hi @ravig-kant
thanks a lot for you contribution, very much appreciated!
I had a few small comments, could you have a look?
Looking forward to merge your PR.

@BoykoAlex
Copy link
Collaborator

Shouldn't the recipe go in spring-boot-upgrade-30 project under the root? Or at lease some Rewrite dependent portion of the SBM recipe?

@ravig-kant
Copy link
Contributor Author

Hi @fabapp2

I have a question about handling Johnzon dependencies for multi-module projects. In such cases should we not be updating the parent projects dependency management section? Also for spring-managed cases, we will have to add a dependency to the child module.

Hi @ravig-kant thanks a lot for you contribution, very much appreciated! I had a few small comments, could you have a look? Looking forward to merge your PR.

Thanks
Ravi

@fabapp2
Copy link
Contributor

fabapp2 commented Jul 30, 2022

Shouldn't the recipe go in spring-boot-upgrade-30 project under the root? Or at lease some Rewrite dependent portion of the SBM recipe?

I'd say it's the right module for now. @sanagaraj-pivotal killed the spring-boot-upgrade-30´ module as this is basically sbm-openrewrite` where the resources were moved to. As the migration is done in plain SBM for now this module is ok imho.

@fabapp2
Copy link
Contributor

fabapp2 commented Aug 1, 2022

Hi @fabapp2

I have a question about handling Johnzon dependencies for multi-module projects. In such cases should we not be updating the parent projects dependency management section? Also for spring-managed cases, we will have to add a dependency to the child module.

Hi @ravig-kant thanks a lot for you contribution, very much appreciated! I had a few small comments, could you have a look? Looking forward to merge your PR.

Thanks Ravi

Hi @ravig-kant

I am currently working on multi-module support.
Moving fixed set versions into a dependencyManagement section is something I could see as a separate recipe.
For this issue it should be enough to just set the version and classifier for all johnson dependencies found.

Making this multi-module aware could be achieved like so:

context.getApplicationModules().stream()
                .map(ApplicationModule::getBuildFile)
                .filter(b -> b.hasDeclaredDependencyMatchingRegex("..."))
                .forEach(this::doSomethingWithBuildFileContainingJohnzonDependency);

@fabapp2
Copy link
Contributor

fabapp2 commented Aug 2, 2022

Hi @ravig-kant,
only a few tweaks are required to merge your PR to main:

  • Remove the checks for imports, just having the dependency without a version (managed by Boot) should trigger the replacement with
<dependency>
            <groupId>org.apache.johnzon</groupId>
            <artifactId>johnzon-core</artifactId>
            <version>1.2.18</version>
	    <classifier>jakarta</classifier>
        </dependency>
  • Add support for classifier in Dependency.fromCoordinates()
  • Making the Action multi module aware by checking all ApplicationModules
  • Adjust the test to expect jakarta as classifier in the added dependency

@fabapp2
Copy link
Contributor

fabapp2 commented Aug 3, 2022

Thanks, @ravig-kant for your contribution 🎉

@fabapp2 fabapp2 merged commit 1a9061c into spring-projects-experimental:main Aug 3, 2022
fabapp2 pushed a commit that referenced this pull request Aug 9, 2022
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.0.0-M1 JSON-B
4 participants