-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
feat: use can change spring.profiles.active's value without rebuild project #4616
feat: use can change spring.profiles.active's value without rebuild project #4616
Conversation
What's the function of |
Codecov Report
@@ Coverage Diff @@
## master #4616 +/- ##
============================================
- Coverage 47.20% 47.16% -0.05%
+ Complexity 1651 1649 -2
============================================
Files 347 347
Lines 10644 10644
Branches 1057 1057
============================================
- Hits 5025 5020 -5
- Misses 5315 5320 +5
Partials 304 304
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I suppose it's not used, we could remove it and test whether the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one thing that I don't understand though. Now that we have one config/application.properties
under the root folder and also one config/application.properties
in the apollo-common.jar
classpath, how come they could be effective together?
apollo-adminservice/src/test/resources/integration.test.properties
Outdated
Show resolved
Hide resolved
apollo-configservice/src/test/resources/integration.test.properties
Outdated
Show resolved
Hide resolved
In org.springframework.boot.context.config.ConfigDataEnvironment, static final ConfigDataLocation[] DEFAULT_SEARCH_LOCATIONS;
static {
List<ConfigDataLocation> locations = new ArrayList<>();
locations.add(ConfigDataLocation.of("optional:classpath:/;optional:classpath:/config/"));
locations.add(ConfigDataLocation.of("optional:file:./;optional:file:./config/;optional:file:./config/*/"));
DEFAULT_SEARCH_LOCATIONS = locations.toArray(new ConfigDataLocation[0]);
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some suggestions to the documentation, please take a look and accept the changes if appropriate. Then we could change the English version too.
…ed_identifiers=true
Co-authored-by: Jason Song <[email protected]>
Co-authored-by: Jason Song <[email protected]>
Co-authored-by: Jason Song <[email protected]>
Co-authored-by: Jason Song <[email protected]>
6dc7563
to
31c2a30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
When user want to use another registry, like consul, nacos, zookeeper etc. they need to change
${apollo_profile}
inbuild.bat
orbuild.sh
to rebuild project, then get a new .zip file.This PR will let user can change
spring.profiles.active=xxx
in configservice and adminservice'sconfig/application.properties
file without rebuild project.Which issue(s) this PR fixes:
Fixes #4610
Brief changelog
Add a new file
config/application.properties
to configservice and adminservice's .zip file.Some error will happen after do that.
Because when multiple
application.properties
in spring boot, only one of them will be keep, moduleapollo-common
'sapplication.properties
is override by configservice and adminservice's.After some research, I move module
apollo-common
'sapplication.properties
in toconfig/application.properties
, it works.(According
org.springframework.boot.env.EnvironmentPostProcessorApplicationListener
,DEFAULT_SEARCH_LOCATIONS
in org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor)Database H2 test will fail too. My way is add
@TestPropertySource("classpath:" + "integration.test.properties")
to@SpringBootTest
.Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.