spring-projects / spring-projects/spring-boot
Expose the functional bean registration API via SpringApplication
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
SpringApplication makes it hard to get hold of the application context before it's refreshed. @michael-simons came up with this:
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addInitializers((GenericApplicationContext ctx) -> {
ctx.registerBean(Greeter.class, Greeter::new);
});
springApplication.run(args);
It would be nice if the initialiser wasn't needed and the API provided an easier way to access the context before it's refreshed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SpringApplication and its addInitializers API, then inspect how the application context is created and refreshed. The issue is complete when the functional bean registration API can be used through SpringApplication before refresh without requiring an initializer, with coverage for the proposed registration flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100