Skip to content

chore: adjust download-maven-plugin usages to reduce release flakiness#13272

Open
whowes wants to merge 4 commits into
mainfrom
whowes/issue-13026-maven
Open

chore: adjust download-maven-plugin usages to reduce release flakiness#13272
whowes wants to merge 4 commits into
mainfrom
whowes/issue-13026-maven

Conversation

@whowes
Copy link
Copy Markdown

@whowes whowes commented May 26, 2026

As observed in issue #13026, the download-maven-plugin's wget goal is currently flaky in release jobs.

This change

  • checks in protos for gapic-generator-java instead of downloading them
  • adjusts the plugin configuration for showcase to skip caching to prevent parallel jobs from trying to acquire the same lock

Fixes #13026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures a custom cacheDirectory for the download-maven-plugin across several POM files. The reviewer pointed out that because <overwrite>true</overwrite> is already set in these configurations, caching is redundant. It is recommended to use <skipCache>true</skipCache> instead of setting a custom cache directory to simplify the configuration and avoid potential cache locking issues.

Comment thread java-showcase/gapic-showcase/pom.xml Outdated
Comment on lines +71 to +73
<cacheDirectory>
${project.build.directory}/download-cache
</cacheDirectory>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since <overwrite>true</overwrite> is configured, the plugin is already instructed to always download the latest version and overwrite the existing file, making caching completely redundant. Instead of configuring a custom cacheDirectory (which is deleted on mvn clean anyway), you can completely disable caching for this execution using <skipCache>true</skipCache>. This avoids any cache locking issues and simplifies the configuration.

              <skipCache>true</skipCache>

Comment on lines +63 to +65
<cacheDirectory>
${project.build.directory}/download-cache
</cacheDirectory>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since <overwrite>true</overwrite> is configured, the plugin is already instructed to always download the latest version and overwrite the existing file, making caching completely redundant. Instead of configuring a custom cacheDirectory (which is deleted on mvn clean anyway), you can completely disable caching for this execution using <skipCache>true</skipCache>. This avoids any cache locking issues and simplifies the configuration.

              <skipCache>true</skipCache>

Comment on lines +71 to +73
<cacheDirectory>
${project.build.directory}/download-cache
</cacheDirectory>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since <overwrite>true</overwrite> is configured, the plugin is already instructed to always download the latest version and overwrite the existing file, making caching completely redundant. Instead of configuring a custom cacheDirectory (which is deleted on mvn clean anyway), you can completely disable caching for this execution using <skipCache>true</skipCache>. This avoids any cache locking issues and simplifies the configuration.

              <skipCache>true</skipCache>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/gemini PTAL after changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look correct and effectively address the cache locking issue by setting <skipCache>true</skipCache> while maintaining the necessary overwrite behavior. This configuration is cleaner and avoids potential issues with shared cache directories in parallel build environments.

@whowes whowes changed the title chore: add cacheDirectory configuration for download-maven-plugin usages chore: disable cache for download-maven-plugin usages May 26, 2026
@whowes whowes changed the title chore: disable cache for download-maven-plugin usages chore: skip cache for download-maven-plugin usages May 26, 2026
@whowes whowes force-pushed the whowes/issue-13026-maven branch from a7189e4 to ba94110 Compare May 26, 2026 23:28
@whowes whowes changed the title chore: skip cache for download-maven-plugin usages chore: adjust download-maven-plugin usages to reduce release flakiness May 26, 2026
@whowes whowes requested a review from blakeli0 May 27, 2026 02:10
@whowes whowes marked this pull request as ready for review May 27, 2026 02:11
@whowes whowes requested a review from a team as a code owner May 27, 2026 02:11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of surprised that it just worked. I though there might be additional configurations needed in the poms. I guess the existing protoc configurations automatically generates everything in main/proto.

Also I think this gapic_metadata.proto probably needs a separate solution because it is a googleapis proto and used in production code not tests. For example, we may want to use automations to sync it from googleapis to java-common-protos.

That being said, for the scope of this PR, I think it's better to still use wget to get the latest gapic_metadata from googleapis and set skipCache to true.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM - I restored wget + compilation for gapic_metadata.proto and reverted the checked-in copy. The restored download execution now has skipCache and overwrite set, mirroring what's done for showcase.

@whowes whowes force-pushed the whowes/issue-13026-maven branch 2 times, most recently from 99db7a3 to 7d7aa93 Compare May 27, 2026 22:39
@whowes whowes force-pushed the whowes/issue-13026-maven branch from 7d7aa93 to 08b090c Compare May 27, 2026 22:42
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sdk-platform-java] maven-download-plugin is flaky when building in parallel.

2 participants