FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Local and inline properties being ignored · Issue #102 · RWS/dxa-web-application-java · GitHub

Local and inline properties being ignored #102

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL