:generateGitProperties git submodule Build FAILED in Heroku

Viewed 3175

My project consist of submodule that I push on Github publicly. But my main repo is private repository. I would like to deploy my Springboot App to Heroku. I tried to follow this step from Heroku.

When I push and deploy to Heroku, the error occurred.

remote:        > Task :generateGitProperties FAILED
remote:
remote:        FAILURE: Build failed with an exception.
remote:
remote:        * What went wrong:
remote:        Execution failed for task ':generateGitProperties'.
remote:        > No .git directory found!

How to solve this problem on heroku?

edit: I tried to remove the submodule first, and the git directory not found issue still found.

2 Answers

I managed to solve this problem. It doesn't have anything to do with submodules. The problem was in the gradle plugin. I put following plugin in the build.gradle

id 'com.gorylenko.gradle-git-properties' version '2.0.0'

This plugin caused :gitGitProperties build failed occurred. So I just removed the plugin and it works :)

Assuming you don't want to expose information about your services you really don't need this dependency. In case you want someone read /info from your git you may consider either use that or other library. " ... When building new application it is also worth to expose basic information about it under /info endpoint... We can customize /info endpoint by adding some supported info sources. This mechanism is very similar to Spring Boot Actuator approach. If git.properties file is available on the classpath, all the values inside file will be exposed by /info endpoint. The same situation applies to build-info.properties file, that needs to be placed inside META-INF directory" copied from https://piotrminkowski.wordpress.com/2019/01/25/quick-guide-to-microservices-with-micronaut-framework/

Related