Gradle loads its version number from a file called version.properties that is in the root dir of the gradle jar.
The IBM jdk provides a version.properties file in the root dir of a jar that is in jre/lib/ext so is on the classpath before the gradle jar.
This means that when the GradleVersion class attempts to load the version.properties file, it gets the one supplied by the jdk and so can't find the properties it wants. This leads to GradleVersion.getVersion() and getBuildTime() returning null.
Running gradle -version shows the version as null.
Running a target leads to:
A problem occurred evaluating root project 'quickstart'.
at org.gradle.configuration.DefaultProjectEvaluator.evaluate(DefaultProjectEvaluator.java:66)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:626)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:62)
at org.gradle.configuration.BuildConfigurer$_closure1.doCall(BuildConfigurer.groovy:41)
at $Proxy1.execute(Unknown Source)
at org.gradle.api.internal.project.AbstractProject.applyActions(AbstractProject.java:597)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:592)
at org.gradle.configuration.BuildConfigurer.process(BuildConfigurer.groovy:48)
at org.gradle.Gradle.runInternal(Gradle.java:113)
at org.gradle.Gradle.run(Gradle.java:93)
at org.gradle.Main.execute(Main.java:253)
at org.gradle.Main.main(Main.java:83)
at org.gradle.BootstrapMain.main(BootstrapMain.java:53)
Caused by: java.lang.NullPointerException
at org.gradle.groovy.scripts.DefaultCachePropertiesHandler.writeProperties(DefaultCachePropertiesHandler.java:34)
at org.gradle.groovy.scripts.DefaultScriptCompilationHandler.writeToCache(DefaultScriptCompilationHandler.java:78)
at org.gradle.groovy.scripts.DefaultScriptProcessor.loadViaCache(DefaultScriptProcessor.java:64)
at org.gradle.groovy.scripts.DefaultScriptProcessor.createScript(DefaultScriptProcessor.java:41)
at org.gradle.configuration.DefaultProjectEvaluator.evaluate(DefaultProjectEvaluator.java:55)
... 12 common frames omitted
Removing the offending jdk supplied jar then running gradle appears to all work properly.
|