-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add contribution model for application configuration #1109
Comments
Yep, that's what happening here. This was raised a few times and I understand the interest but I can't see that happening at the moment. I've flagged this for team attention to see what the rest of the team things. I've also moved that to the library as I don't think this would be 100% on the service-side only. |
It feels to me like something that the library could support but we'd choose not to use it on start.spring.io. |
Yeah although the current contributor right now create an empty file. If we support yaml-based config, It would make sense to offer a model where users can contribute keys and then the configuration is written in either format. If we decide not to use this on start.spring.io, I'd argue we have other areas of the library that needs improving with more impacts on our service. |
I agree. |
I've repurposed this issue as an enhancement in the library. |
As a workaround: import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import io.spring.initializr.generator.project.contributor.ProjectContributor;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
class DeleteFileProjectContributor implements ProjectContributor {
private final String path;
@Override
public void contribute(final Path projectRoot) throws IOException {
final var file = projectRoot.resolve(path);
Files.delete(file);
}
@Override
public int getOrder() {
return 1;
}
}
@ProjectGenerationConfiguration
class CustomProjectGenerationConfiguration {
@Bean
ProjectContributor deleteApplicationPropertiesProjectContributor() {
return new DeleteFileProjectContributor("src/main/resources/application.properties");
}
} |
I'm sorry if I highjack this ticket, but I feel the real question should be, why using
I don't mind creating a new ticket if it helps to consider this option, I was just feeling if my suggestion is took in consideration and adopted, then this ticket would lose a lot of interest. |
I would love to be able to create a new project that contains an
application.yml
instead of anapplication.properties
file.Maybe as an option?
properties=yaml
Or maybe
whiteSpaceBugs=true
Joking aside, we commonly give instructions to rename app.props to app.yml after creating a new project and then provide example configuration in YAML format.
I can understand the desire to keep the number of permutations down, so feel free to close this issue!
Thanks again!
The text was updated successfully, but these errors were encountered: