diff --git a/build.gradle b/build.gradle
index 5b769428500054134fdb3d9a418393ad21db2ca8..7cb662e7244d19cead9f65922b23daff963032d9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -41,8 +41,7 @@ java {
 
 jar {
   doFirst {
-    def versionPath = "/resources/main/version.json"
-    def versionFile = new File(project.buildDir.toString() + versionPath)
+    def versionFile = new File("${projectDir}/src/main/resources/version.json")
     def details = versionDetails()
     def versionInfo = [
       branchName: details.branchName,