This message was deleted.
# community-support
s
This message was deleted.
c
If you’re using those pattern resolvers from a Gradle task that will not work via the classpath, as the task’s classpath is different than the classpath of what you are building. If you do need those files at build time you’ll need to reference the filesystem, not the classpath.
d
Ok it's the end of the work day and I've managed to do it by adding
file:
to the search path:
Copy code
StandardEnvironment environment = new StandardEnvironment();
		PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver()
		for (final def resDir in sourceSets.main.getResources().srcDirs) {
			<http://project.logger.info|project.logger.info>("resDir: " + resDir.toString())
			String searchPath = Paths.get("file:" + resDir.toString(), "*.properties").toString()
			<http://project.logger.info|project.logger.info>("searchPath: " + searchPath)
			var resources = resourcePatternResolver.getResources(searchPath)
			for (final def res in resources) {
				<http://project.logger.info|project.logger.info>("Found resource " + res.filename)
			}
		}
This is a part of the task
Now I have to add these resources to the Spring Environment
I did it. Could you please look at my previous question https://gradle-community.slack.com/archives/CAHSN3LDN/p1686575753063799 and tell me if this is the status quo (property duplication), because if it is, I'll make this into a gradle plugin.