File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ COPY .mvn/ .mvn/
77COPY mvnw pom.xml ./
88RUN ./mvnw dependency:go-offline
99
10- # Copy source and build
10+ # Copy source and .git directory for git-commit-id-plugin
1111COPY src ./src
12+ COPY .git ./.git
13+
14+ # Build the application
1215RUN ./mvnw clean package -DskipTests
1316
1417# Extract layers for better caching
Original file line number Diff line number Diff line change 138138 <plugin >
139139 <groupId >pl.project13.maven</groupId >
140140 <artifactId >git-commit-id-plugin</artifactId >
141+ <configuration >
142+ <failOnNoGitDirectory >false</failOnNoGitDirectory >
143+ <generateGitPropertiesFile >true</generateGitPropertiesFile >
144+ <includeOnlyProperties >
145+ <includeOnlyProperty >^git.branch$</includeOnlyProperty >
146+ <includeOnlyProperty >^git.commit.id.(abbrev|full)$</includeOnlyProperty >
147+ <includeOnlyProperty >^git.commit.time$</includeOnlyProperty >
148+ </includeOnlyProperties >
149+ </configuration >
141150 </plugin >
142151 <plugin >
143152 <groupId >org.codehaus.mojo</groupId >
You can’t perform that action at this time.
0 commit comments