Skip to content

Commit 0fc714f

Browse files
committed
fixes issue with git-commit plugin
1 parent d110215 commit 0fc714f

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ COPY .mvn/ .mvn/
77
COPY mvnw pom.xml ./
88
RUN ./mvnw dependency:go-offline
99

10-
# Copy source and build
10+
# Copy source and .git directory for git-commit-id-plugin
1111
COPY src ./src
12+
COPY .git ./.git
13+
14+
# Build the application
1215
RUN ./mvnw clean package -DskipTests
1316

1417
# Extract layers for better caching

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@
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>

0 commit comments

Comments
 (0)