I'm writing a gradle plugin that wishes to read specific properties file from resources of a project of which this plugin is applied to. To read those resources, I need a classpath of the project. Currently I'm going with:
org.gradle.api.Project.getBuildscript().getClassLoader().getResourcesAsStream(...)
But it always returns null even though such resource exists in that project.
Gradle buildscript is comilped and put into a local cache, so the project is not on the classpath of buildscript classloader. What you need is probably
org.gradle.api.Project. absoluteProjectPath()
.e.g. To read "src/main/resources/META-INF/MANIFEST.MF":