Skip to content

Commit 9feef8b

Browse files
committed
Fix cache warmer: add clean + resolve all declared plugins
maven-clean-plugin:3.2.0 and exec-maven-plugin:1.2.1 were missing from cache because: - warmer ran without 'clean' lifecycle (missed maven-clean-plugin) - exec-maven-plugin has no lifecycle binding (only declared, not bound) Fix: add 'clean' to all steps AND add dependency:resolve-plugins step to resolve ALL declared plugins including those without executions. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
1 parent a00b908 commit 9feef8b

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/warmMavenCache.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,32 +131,35 @@ 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
158+
159+
# Step 6: Resolve all declared plugins (including those without executions,
160+
# like exec-maven-plugin which is declared in the POM but not lifecycle-bound).
161+
echo "=== Step 6: Resolving all declared plugins ==="
162+
mvn -B -pl jdbc-core dependency:resolve-plugins -Ddependency-check.skip=true || true
160163
161164
echo "Dependency resolution complete"
162165

0 commit comments

Comments
 (0)