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

Local and inline properties being ignored #102

Open
jajimene opened this issue May 3, 2018 · 0 comments
Open

Local and inline properties being ignored #102

jajimene opened this issue May 3, 2018 · 0 comments

Comments

@jajimene
Copy link

jajimene commented May 3, 2018

We've created several xxx.properties files for different environments and tried to add them using the spring.profiles.active as stated in DXA's documentation. However, although the profile is properly picked up, the properties file is being ignored.

I debugged the DxaSpringInitialization class that defines the required beans for DXA, and found the first one is loading all the dxa.*.properties file by using the following method:
https://github.com/sdl/dxa-web-application-java/blob/51b8cdee1ad683d1ca778d5e465b3f4ab83bbe9f/dxa-framework/dxa-common-api/src/main/java/com/sdl/dxa/DxaSpringInitialization.java#L60

The Javadoc for the method configurer.setPropertySources(propertySources); says:

Setting this property indicates that environment property sources and local properties should be ignored.

I suspect defining the placeholderConfigurer bean that way causes DXA to ignore any .properties file not included in
https://github.com/sdl/dxa-web-application-java/blob/1610c7be29c038ffebf340bb8c44c5046de607cf/dxa-framework/dxa-common-api/src/main/java/com/sdl/webapp/common/util/InitializationUtils.java#L104

It also causes the application to ignore any inline property you try to set during execution, like:

java -jar MyDxaApp-bootified.jar --server.port=8081

See also: https://tridion.stackexchange.com/questions/18792/dxa-java-web-application-profile-specific-properties

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