I am building a Custom gradle plugin which when applied to the projects will use the configuration files in the project resources folder to fill some templates and generate some other configuration files.
But when I read the files in my plugin as classpath resources, it fails with cant find the File.
public class VideoBuildPlugin implements Plugin<Project> {
@Override
public void apply(Project target) {
String file = "app/config/dev.yml"; // These files reside in the resources of the project folder
VideoBuildPlugin.class.getClassLoader().getResourceAsStream(file); // This line fails
}
}
Do I have to do, to add the project resources to the classpath of the build plugin to get this working?