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

Separating application.properties into different files based on profile #562

Open
ishish07 opened this issue Aug 11, 2024 · 1 comment
Open
Assignees
Labels
recipe Recipe requested

Comments

@ishish07
Copy link

What problem are you trying to solve?

Application.Properties files sometimes specify different profiles and/or environments using property file separators (#--- or !---) as seen here:

Sometimes, it is preferred to separate these profiles into their own application-profile.properties files for organizational purposes. The names of these separate profiles are configured by the spring.config.activate.on-profile property.

What precondition(s) should be checked before applying this recipe?

If an application.properties file exists in the codebase.

Describe the situation before applying the recipe

BeforeRecipe

Describe the situation after applying the recipe

AfterRecipe

Any additional context

This is similar to the yaml document separator

During my internship this summer, I had to manually separate these files during our migration to Java 21. I have created a recipe so that others do not have to manually separate files and delete content in application.properties.

Are you interested in contributing this recipe to OpenRewrite?

Yes I am!

I have written the code, ran tests, and would like to create a draft pull request.

@timtebeek
Copy link
Contributor

Thanks for the suggestion & offer to help @ishish07 ! I had no idea the same was supported for properties files. Yes makes sense to do offer the same there, and I look forward to your PR.

@timtebeek timtebeek moved this to Backlog in OpenRewrite Aug 11, 2024
@timtebeek timtebeek added the recipe Recipe requested label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe requested
Projects
Status: Backlog
Development

No branches or pull requests

2 participants