[ https://issues.apache.org/jira/browse/DELTASPIKE-1364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16971205#comment-16971205 ]
ASF subversion and git services commented on DELTASPIKE-1364: ------------------------------------------------------------- Commit 63bbcfb75f437c7cee2578c07a4131e18e709ecf in deltaspike's branch refs/heads/master from Mark Struberg [ https://gitbox.apache.org/repos/asf?p=deltaspike.git;h=63bbcfb ] DELTASPIKE-1364 Variables in @ConfigProperty Unit test only. Seems I already fixed that while reworking the Config to an interface. > Variable Replacement with @ConfigProperty not project stage aware > ----------------------------------------------------------------- > > Key: DELTASPIKE-1364 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1364 > Project: DeltaSpike > Issue Type: Bug > Components: Configuration > Affects Versions: 1.8.2 > Reporter: Nicolò Chieffo > Assignee: Mark Struberg > Priority: Major > > reading a property with injection does not correctly use project stage > properties. > I have a property file with this content: > > {code:java} > xxx.frontend.prefix=https://dev.xxx.it > xxx.frontend.prefix.Production=https://prod.xxx.it > xxx.rsalogin.url=${xxx.frontend.prefix}/#/rsalogin/{rsalogin} > {code} > > > when reading xxx.rsalogin.url using annontations > {code:java} > @Inject > @ConfigProperty(name = "xxx.rsalogin.url") > private String url; > {code} > In the production environment (noticed that I don't have a > org.apache.deltaspike.ProjectStage=Production property set because by default > the stage is Production) it should be evaluated as > *[https://prod.xxx.it/#/rsalogin/\{rsalogin}|https://prod.xxx.it/#/rsalogin/]* > but instead I get > *[https://dev.xxx.it/#/rsalogin/\{rsalogin}|https://dev.xxx.it/#/rsalogin/]* > When using the declarative API it works correctly > {code:java} > ConfigResolver.getProjectStageAwarePropertyValue("xxx.rsalogin.url", > "");{code} > -- This message was sent by Atlassian Jira (v8.3.4#803005)