draft-classic icon indicating copy to clipboard operation
draft-classic copied to clipboard

Spring Boot build in Draft fails because of missing .git folder

Open mrumpf opened this issue 6 years ago • 1 comments

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>

mrumpf avatar May 04 '18 14:05 mrumpf

I hit this too. I had to remove .git from the .dockerignore file so it's available as part of Docker context

dkirrane avatar Jul 05 '18 10:07 dkirrane