This is an automated email from the ASF dual-hosted git repository. pkarwasz pushed a commit to branch feature/simplify-dep-management in repository https://gitbox.apache.org/repos/asf/logging-log4j-samples.git
commit c35027e3eea24827e13b4ebc82b8aa8fba7d4b6c Author: Piotr P. Karwasz <pkarwasz-git...@apache.org> AuthorDate: Thu Apr 10 23:54:53 2025 +0200 Remove Apache Snapshots from release builds This PR: - Limits the usage of `repository.apache.org` to artifacts in the `org.apache.logging` group. - Uses the Snapshots repository only if `log4j.repository.url` is not specified or empty. --- settings.gradle | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/settings.gradle b/settings.gradle index 9b3d409..8bdb9c3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,28 +22,22 @@ pluginManagement { } } dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() + // Points to the correct Apache staging repository + var apacheSnapshots = 'https://repository.apache.org/snapshots' + var repositoryUrl = providers.gradleProperty('log4j.repository.url') + .filter { !it.isEmpty() } + .getOrElse(apacheSnapshots) maven { - name = 'Apache Snapshots Repository' - url = "https://repository.apache.org/snapshots" + name = 'Log4j Repository' + url = repositoryUrl mavenContent { - snapshotsOnly() - } - } - // Points to the correct Apache staging repository - // - // See gradle.properties - var repositoryUrl = providers.gradleProperty("log4j.repository.url") - if (repositoryUrl != null && !repositoryUrl.toString().isEmpty()) { - maven { - name = 'Apache Repository' - url = repositoryUrl - mavenContent { - releasesOnly() - } + // Only use this repository for Apache Logging Services artifacts + includeGroupAndSubgroups('org.apache.logging') + // Only use this repository for either snapshots or releases + repositoryUrl == apacheSnapshots ? snapshotsOnly() : releasesOnly() } } }