Create a @Scope bean to make a prototype scope with @Configuration. @Configuration represents the configure file of a SpringBoot project. Here's a piece of code that shows how to use the @Scope prototype annotation:
@Configuration public class ConfigFoo { @Bean @Scope("prototype") public Foo foo() { return new Foo(); } }