Skip to content

The @ActiveProfiles throws exception while trying to overriding properties file values #21791

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

Closed
tamademicheli opened this issue Jun 9, 2020 · 3 comments
Assignees
Labels
type: wiki-documentation A documentation update required on the wiki

Comments

@tamademicheli
Copy link

tamademicheli commented Jun 9, 2020

IS: while upgrading from SpringBoot 2.2.7 to 2.3.0, the overriding behaviour of @activeprofiles changed without notice on the migration. This test works with 2.2.7 and not with 2.3.0 https://github.com/tamademicheli/springboot230issueTestActiveProfile/blob/master/demo23/src/test/java/com/example/demo23/ActiveProfilesTestBackendTest.java

SHOULD: work in both version. if not please add to the migration path this breaking change and how we should accomplish to override properties likely as the linked test.

A similar issue which could be related to that:
#21302

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'mybackendvalue' in value "${mybackendvalue}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 9, 2020
@scottfrederick
Copy link
Contributor

This change was caused by a bug fix (#19537) that prevented profile names containing commas from being activated. To enable multiple profiles, you should provide each as a separate value, as in

@ActiveProfiles({"backend", "test"})

@scottfrederick scottfrederick self-assigned this Jun 9, 2020
@scottfrederick scottfrederick added type: wiki-documentation A documentation update required on the wiki and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 9, 2020
@scottfrederick
Copy link
Contributor

@tamademicheli
Copy link
Author

Thank you , that helped a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: wiki-documentation A documentation update required on the wiki
Projects
None yet
Development

No branches or pull requests

3 participants