Skip to content

chore: skip cache for download-maven-plugin usages#13272

Draft
whowes wants to merge 2 commits into
mainfrom
whowes/issue-13026-maven
Draft

chore: skip cache for download-maven-plugin usages#13272
whowes wants to merge 2 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 adjusts the configuration of the plugin everywhere it's used in the repo to skip caching. This way none of the jobs run during the release should be 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
@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.

1 participant