Skip to content

Commit 4545276

Browse files
committed
Fix cache warmer: add 'clean' to all steps to cache maven-clean-plugin
maven-clean-plugin:3.2.0 and exec-maven-plugin:1.2.1 were missing from cache because the warmer used 'mvn install' and 'mvn test' without 'clean'. The CI workflows run 'mvn clean test', which requires these plugins. Added 'clean' to every warmer step to match CI commands. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
1 parent a00b908 commit 4545276

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/warmMavenCache.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,32 +131,30 @@ jobs:
131131
run: |
132132
set -euo pipefail
133133
134+
# Use 'clean' in every step to match the CI commands exactly.
135+
# This ensures maven-clean-plugin and all lifecycle-bound plugins
136+
# (exec-maven-plugin, etc.) are resolved and cached.
137+
134138
# Step 1: Install all modules — resolves external dependencies from JFrog and
135139
# installs inter-module SNAPSHOTs (e.g., jdbc-core used by assembly-thin/uber).
136140
echo "=== Step 1: Installing all modules ==="
137-
mvn -B install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Ddependency-check.skip=true
138-
139-
# Step 2: Run the exact same commands that PR workflows use.
140-
# This ensures ALL plugins, providers, and metadata are resolved and cached,
141-
# including test-time artifacts (surefire-junit-platform, jacoco agent) and
142-
# build-time plugins (spotless, toolchains, owasp) that mvn install alone
143-
# doesn't trigger.
141+
mvn -B clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Ddependency-check.skip=true
144142
145143
# Step 2: Run a real unit test to trigger full surefire provider resolution.
146144
# surefire-junit-platform is resolved lazily at test execution time, not at
147145
# plugin initialization. We need at least one test to actually run.
148146
echo "=== Step 2: Running a single unit test to resolve surefire provider ==="
149-
mvn -B -pl jdbc-core test -Dtest="DatabricksParameterMetaDataTest#testInitialization" -Ddependency-check.skip=true || true
147+
mvn -B -pl jdbc-core clean test -Dtest="DatabricksParameterMetaDataTest#testInitialization" -Ddependency-check.skip=true || true
150148
151149
echo "=== Step 3: Running spotless check ==="
152150
mvn -B --errors spotless:check || true
153151
154152
# Step 4: Run jacoco with a real test to resolve jacoco agent + report plugins
155153
echo "=== Step 4: Running jacoco coverage ==="
156-
mvn -B -pl jdbc-core test -Dtest="DatabricksParameterMetaDataTest#testInitialization" jacoco:report -Ddependency-check.skip=true || true
154+
mvn -B -pl jdbc-core clean test -Dtest="DatabricksParameterMetaDataTest#testInitialization" jacoco:report -Ddependency-check.skip=true || true
157155
158156
echo "=== Step 5: Running integration test compilation ==="
159-
mvn -B -pl jdbc-core compile test-compile -Ddependency-check.skip=true || true
157+
mvn -B -pl jdbc-core clean compile test-compile -Ddependency-check.skip=true || true
160158
161159
echo "Dependency resolution complete"
162160

0 commit comments

Comments
 (0)