Skip to content

Commit c079ed4

Browse files
gopalldbclaude
andauthored
Fix fork Maven config: set updatePolicy=never to prevent 401 on cached artifacts (#1389)
## Summary Even with artifacts in the local cache (~350MB restored successfully), Maven checks the remote repository for POM metadata updates. For forked PRs the JFrog mirror has no credentials, so these update checks get 401 errors — causing `maven-toolchains-plugin:3.2.0` resolution to fail even though the JAR is cached. Fix: for forked PRs only, configure repository and pluginRepository with `updatePolicy=never` in an active profile. This tells Maven to use cached artifacts without contacting the remote for updates. The non-fork path (JFrog OIDC with full credentials) is unchanged. ## Test plan - [ ] Re-run PR #1371 CI after merge — toolchains plugin should resolve from cache without 401 NO_CHANGELOG=true This pull request was AI-assisted by Isaac. --------- Signed-off-by: Gopal Lal <gopal.lal@databricks.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c2282cd commit c079ed4

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

.github/actions/setup-maven/action.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,33 @@ runs:
3535
<url>https://databricks.jfrog.io/artifactory/db-maven/</url>
3636
</mirror>
3737
</mirrors>
38-
<!-- No <servers> block: forked PRs use cached dependencies only.
39-
Any cache miss will produce a clear HTTP 401 error indicating
40-
the dependency is not in cache. Ask a maintainer to run the
41-
"Warm Maven Dependency Cache" workflow with your PR number. -->
38+
<!-- No <servers> block: forked PRs use cached dependencies only. -->
39+
<!-- updatePolicy=never prevents Maven from checking the remote for
40+
updates, avoiding 401 errors when artifacts are already cached. -->
41+
<profiles>
42+
<profile>
43+
<id>cache-only</id>
44+
<repositories>
45+
<repository>
46+
<id>jfrog-central</id>
47+
<url>https://databricks.jfrog.io/artifactory/db-maven/</url>
48+
<releases><updatePolicy>never</updatePolicy></releases>
49+
<snapshots><updatePolicy>never</updatePolicy></snapshots>
50+
</repository>
51+
</repositories>
52+
<pluginRepositories>
53+
<pluginRepository>
54+
<id>jfrog-central</id>
55+
<url>https://databricks.jfrog.io/artifactory/db-maven/</url>
56+
<releases><updatePolicy>never</updatePolicy></releases>
57+
<snapshots><updatePolicy>never</updatePolicy></snapshots>
58+
</pluginRepository>
59+
</pluginRepositories>
60+
</profile>
61+
</profiles>
62+
<activeProfiles>
63+
<activeProfile>cache-only</activeProfile>
64+
</activeProfiles>
4265
</settings>
4366
SETTINGS_EOF
4467

0 commit comments

Comments
 (0)