diff --git a/build.gradle b/build.gradle index 3d52d4ab279..c843069f43e 100644 --- a/build.gradle +++ b/build.gradle @@ -81,7 +81,7 @@ subprojects { nexus { String buildSnapshot = System.getProperty('build.snapshot', 'true') if (buildSnapshot == 'false') { - Repository repo = new RepositoryBuilder().findGitDir(new File('.')).build() + Repository repo = new RepositoryBuilder().findGitDir(project.rootDir).build() String shortHash = repo.resolve('HEAD')?.name?.substring(0,7) repositoryUrl = project.hasProperty('build.repository') ? project.property('build.repository') : "file://${System.getenv('HOME')}/elasticsearch-releases/${version}-${shortHash}/" }