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
Allow overriding the default Gradle library repository through a new Gradle property #26743
Conversation
Thank you for your interest in Gradle. The implementation does not match the proposed solution on the related issue. Please rework your implementation to match the design. The solution should use a Gradle property instead of a system property and provide tests to verify the functionality. |
8fe68af
to
748c38f
Compare
@cobexer thanks for your comment. I have updated the PR as requested. It is now looking for a Gradle property and I have copied 3 of the existing tests (that were using the env var for override) and modified them to use the new property. Please check. |
684da6a
to
c8d68a4
Compare
Thank you for your contribution! This PR has a valid DCO and tests. The relevant team for this area will confirm the design of the implementation choices. |
c8d68a4
to
2e6ea2c
Compare
Change SummaryThis PR is 89.82% new code.
|
This PR in its current state would already be really helpful for people sitting behind corporate firewalls and proxies. However I agree with @SidB3's comment on #25840: in some cases users need full control over how that maven repository (used by So the support for that use case could be added (either as part of this PR or in a followup PR) with some DSL additions that would allow users to provide a custom My questions to the reviewer(s) from the Gradle Team are: do you agree with this train of thought? Would you be supportive to have the custom-maven-config-action-DSL? |
12ce195
to
8baf6c1
Compare
My only question would be in regards to portability. Will this only work if all users and CI use the same OS type? Does it support What takes precedence, env or the new property? |
8baf6c1
to
8fc5b3e
Compare
…property called `org.gradle.internal.gradle.libs.repo.override` (previously overriding was only possible through the `GRADLE_LIBS_REPO_OVERRIDE` environment variable). The property can be more useful because it can be defined in the build itself (either through gradle.properties or programmatically) Signed-off-by: akiraly <kiralyattila.hu@gmail.com>
8fc5b3e
to
c3b6df8
Compare
@leonard84 thanks for taking a look at this. Let me try to answer your questions out of order:
|
Thanks @akiraly for some reason I was assuming that it was referring to a file system location, if it is mainly intended for web resources, then I agree that my points are mostly irrelevant. |
@akiraly thanks for your efforts with this PR. |
We've picked up the ball and resumed the conversation on this pull request. We still have a few things to sort out, but my understanding is that we actually want to get rid of the property altogether. The Gradle libs URLs was a workaround because the |
@donat thanks, that would be the cleanest. I assume that way the global repository configuration (url, authentication, etc...) would apply to these resolutions as well? |
Exactly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs LGTM
To be explicit, we're not planning to accept this PR. Instead, we'll aim for the improving the dependency resolution for |
Allow overriding the default Gradle library repository through a new Gradle property called
org.gradle.internal.gradle.libs.repo.override
(previously overriding was only possible through theGRADLE_LIBS_REPO_OVERRIDE
environment variable).The Gradle property can be more useful because it can be defined in the build itself (either through gradle.properties or programmatically)
Context
This can be useful for every project which needs to override the default Gradle library repository (typical in corporate settings, behind a firm firewall). While the environment variable works it is not convenient: each developer has to define the environment variable manually in his/her dev environment. The Gradle property is more practical because it can be defined inside the build and kept together with the rest of the build configuration in the source repository.
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew sanityCheck
./gradlew <changed-subproject>:quickTest
Reviewing cheatsheet
Before merging the PR, comments starting with