draft-classic
draft-classic copied to clipboard
Spring Boot build in Draft fails because of missing .git folder
Many Spring Boot applications use the git-commit-id Maven plugin to read some information (e.g. revision) from the Git repository and later display it under the Spring Boot Actuator endpoint /info.
This fails with the current Draft Java pack because the Git repository is not available in the Docker container.
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
</configuration>
</plugin>
I hit this too. I had to remove .git
from the .dockerignore
file so it's available as part of Docker context