Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.93k stars 397 forks source link

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

Open mrumpf opened 6 years ago

mrumpf commented 6 years ago

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>
dkirrane commented 6 years ago

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