Skip to content

Gradle: Add buildSrc to the sample project #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

MartyIX
Copy link

@MartyIX MartyIX commented Jul 14, 2025

This is an attempt to add buildSrc for apache/logging-log4j2#3822 to address apache/logging-log4j2#3779 (comment).

However, I'm not sure why but 2.25.1 works here but not for my personal project. Meaning, I did not reproduce what I wrote here apache/logging-log4j2#3779 (comment).

Any thought @ppkarwasz please?

Testing

# Fails (as expected)
export LOG4J_VERSION=2.25.0; ./gradlew :log4j-samples-gradle-metadata:build # Run from the repo's root directory!

# Works (but `buildSrc` project should report an error-prone version error but it does not.
export LOG4J_VERSION=2.25.1; ./gradlew :log4j-samples-gradle-metadata:build

Resources

https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:sharing_logic_via_convention_plugins

@ppkarwasz
Copy link
Contributor

Hi @MartyIX,

Thanks again for digging into this — even negative results are valuable, as they help us identify what might be missing in the test project.

Based on Copilot’s analysis, the error message you encountered doesn't appear to originate from Gradle itself, but rather from the Spring Dependency Management Plugin.

Would you be able to try applying the plugin to the log4j-samples-gradle-metadata project to see if it reproduces the issue? Ideally, it would be great if the problem can be triggered without introducing an additional buildSrc project.

You can apply the plugin like this:

id "io.spring.dependency-management" version "1.1.7"

If that reproduces the error, could you also check whether switching to the native Gradle platform support (via platform() or enforcedPlatform()) serves as a viable workaround in your own project?

@MartyIX
Copy link
Author

MartyIX commented Jul 15, 2025

That's great insight! I opened #351 which reports the error.

I'm closing this PR.

@MartyIX MartyIX closed this Jul 15, 2025
@MartyIX MartyIX deleted the gradle-buildSrc-2 branch July 15, 2025 17:15
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.

2 participants