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

Support for ant wildcards in configuration properties #12993

Closed
filiphr opened this issue Apr 27, 2018 · 8 comments
Closed

Support for ant wildcards in configuration properties #12993

filiphr opened this issue Apr 27, 2018 · 8 comments
Labels
status: duplicate A duplicate of another issue

Comments

@filiphr
Copy link
Contributor

filiphr commented Apr 27, 2018

I have the following configuration properties

@ConfigurationProperties(prefix = "dummy")
public DummyProperties {

    private Resource[] dummyFiles;

    // getters and setters
}

And then in my application.properties

dummy.dummy-files=classpath*:/com/example/dummy/*.json

When this is done then DummyProperties#dummyFiles contains a single ServletContextResource.
If you change the property to classpath*:/com/example/dummy/single.json then it works correctly.

I asked in the gitter channel and @snicoll said that you don't support this. However, I didn't understand if this is on purpose or it's just not implemented. If it is the first sorry for opening this issue and feel free to close it.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 27, 2018
@snicoll
Copy link
Member

snicoll commented Apr 28, 2018

@filiphr we're using Spring Framework's property editor for this and I don't think that ant-style patterns are supported so I'd assume that this issue will have to move to the framework. But let's use the opportunity of this issue to figure out what we can do.

@snicoll snicoll self-assigned this Apr 28, 2018
@filiphr
Copy link
Contributor Author

filiphr commented Apr 28, 2018

I am not sure what the property editor from Spring Framework is. One thing I know is that when the same expression is used in @Value everything works correctly.

For example doing:

@Value("${dummy.dummy-files}")
private Resource[] resources;

Maybe different strategy is used for @Value and @ConfigurationProperties. To me they are "similar" and that is why I expected that to work.

Thanks for having a look at it.

@snicoll
Copy link
Member

snicoll commented Apr 28, 2018

One thing I know is that when the same expression is used in @Value everything works correctly.

Well that's crucial to the report. It means then we have to configure something on the Spring Boot side as @Value is a Spring Framework feature.

@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 28, 2018
@snicoll snicoll added this to the Backlog milestone Apr 28, 2018
@snicoll
Copy link
Member

snicoll commented May 2, 2018

It is interesting to see that @PropertySource does not support that either

@snicoll snicoll modified the milestones: Backlog, Icebox May 2, 2018
@snicoll snicoll removed their assignment May 2, 2018
@rfelgent
Copy link

rfelgent commented Jul 4, 2018

Hello,

are there any new information about progress ? I miss that feature "ant style path patterns" for configuration properties in my project, too. I use SB 1.5.10

@philwebb
Copy link
Member

philwebb commented Jul 4, 2018

@rfelgent There's not been any recent updates to the issue and since it's a relatively low priority nobody is actively working on it. It might be easer to fix this with Spring Boot 2.0 as much of the property binding support was rewritten. Even if we find a fix, I'm afraid we won't be adding this to Spring Boot 1.5.x.

@mbhave
Copy link
Contributor

mbhave commented Jul 1, 2019

I think this a duplicate of #15835. Feel free to reopen if it isn't.

@mbhave mbhave closed this as completed Jul 1, 2019
@mbhave mbhave added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Jul 1, 2019
@mbhave mbhave removed this from the General Backlog milestone Jul 1, 2019
@filiphr
Copy link
Contributor Author

filiphr commented Jul 1, 2019

@mbhave yes #15835 is the same issue as this one. This one is an older issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

6 participants