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

The logic behind Profile({"!prod", "!qa"}) #110

Open
sundalei opened this issue Nov 1, 2021 · 0 comments
Open

The logic behind Profile({"!prod", "!qa"}) #110

sundalei opened this issue Nov 1, 2021 · 0 comments

Comments

@sundalei
Copy link

sundalei commented Nov 1, 2021

Hi Guys, I'm a bit confused about this. Here, the bean dataLoader will be created if if neither the prod nor qa profiles are active.

@Profile({"!prod", "!qa"})
@Configuration
public class DevelopmentConfig {
  @Bean
  public CommandLineRunner dataLoader(IngredientRepository repo,
        UserRepository userRepo, PasswordEncoder encoder) {
    ...
}
}

What I thought was that, if profile prod was active, the bean would not be created. However, the bean created because of prod was !qa. So, is it correct to say, one of the two is matched, the bean is created.

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

No branches or pull requests

1 participant