A minimal complete verifiable example of reading from resource seemingly not working from a precompiled script Gradle plugin.
To reproduce:
- In the convention-plugins project run
gradle publishToMavenLocal
. - In the service project run
gradle resourceFromNormalPlugin
: this should printtext to print
from resource.txt. - In the service project run
gradle resourceFromScriptPlugin
: this should also printtext to print
but instead fails becausejavaClass.getResource("/resource.txt")
is null.