Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build-tools/build-infra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ plugins {
alias(libs.plugins.diffplug.spotless) apply false
}

repositories {
mavenCentral()
}
apply from: file("declare-repositories.gradle")

group = "org.apache"

Expand Down
42 changes: 42 additions & 0 deletions build-tools/build-infra/declare-repositories.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Central repository declarations for every consumption scope: plugin resolution
// (pluginManagement), project dependencies, buildscript classpath, and the
// build-infra / missing-doclet included builds. Applied via
// `apply from: <this>, to: <handler>` onto whichever object owns the repositories.
//
// Your enterprise mirror: set the `solr.maven.repo.url` system property (via
// -Dsolr.maven.repo.url=..., or systemProp.solr.maven.repo.url=... in gradle.properties) or
// the equivalent SOLR_MAVEN_REPO_URL environment variable to route every scope through a
// single internal mirror (e.g. Artifactory/Nexus) instead of public repositories. System
// properties and environment variables are inherited by the included builds, so one setting
// covers the entire build.

def mirrorUrl = System.getProperty('solr.maven.repo.url') ?: System.getenv('SOLR_MAVEN_REPO_URL')

repositories {
if (mirrorUrl) {
maven {
// name = 'yourEnterpriseMirror'
url = mirrorUrl
}
} else {
mavenCentral()
gradlePluginPortal()
}
}
4 changes: 4 additions & 0 deletions build-tools/build-infra/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* limitations under the License.
*/

pluginManagement {
apply from: file("declare-repositories.gradle"), to: delegate
}

rootProject.name = 'build-infra'

// Use project's version catalog for centralized dependency management
Expand Down
4 changes: 1 addition & 3 deletions build-tools/missing-doclet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ plugins {
alias(libs.plugins.diffplug.spotless) apply false
}

repositories {
mavenCentral()
}
apply from: file("../build-infra/declare-repositories.gradle")

group = "org.apache.solr.tools"
description = 'Doclet-based javadoc validation'
Expand Down
4 changes: 4 additions & 0 deletions build-tools/missing-doclet/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* limitations under the License.
*/

pluginManagement {
apply from: file("../build-infra/declare-repositories.gradle"), to: delegate
}

rootProject.name = "missing-doclet"

// Use project's version catalog for centralized dependency management
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: >
Centralize Maven repository declarations for the build. Can customize with SOLR_MAVEN_REPO_URL.
type: other
authors:
- name: David Smiley
links:
- name: PR#4677
url: https://github.com/apache/solr/pull/4677
26 changes: 12 additions & 14 deletions gradle/documentation/markdown.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@
* limitations under the License.
*/

import com.vladsch.flexmark.ast.Heading;
import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension;
import com.vladsch.flexmark.ext.attributes.AttributesExtension;
import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
import com.vladsch.flexmark.html.HtmlRenderer;
import com.vladsch.flexmark.parser.Parser;
import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.util.ast.Document;
import com.vladsch.flexmark.util.data.MutableDataSet;
import com.vladsch.flexmark.util.sequence.Escaping;
import groovy.text.SimpleTemplateEngine;
import com.vladsch.flexmark.ast.Heading
import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension
import com.vladsch.flexmark.ext.attributes.AttributesExtension
import com.vladsch.flexmark.ext.autolink.AutolinkExtension
import com.vladsch.flexmark.html.HtmlRenderer
import com.vladsch.flexmark.parser.Parser
import com.vladsch.flexmark.parser.ParserEmulationProfile
import com.vladsch.flexmark.util.ast.Document
import com.vladsch.flexmark.util.data.MutableDataSet
import com.vladsch.flexmark.util.sequence.Escaping
import groovy.text.SimpleTemplateEngine

buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.flexmark.flexmark
Expand Down
13 changes: 1 addition & 12 deletions gradle/globals.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import javax.inject.Inject
import org.gradle.process.ExecOperations

interface ExecOperationsHolder {
@Inject
Expand All @@ -28,18 +27,8 @@ allprojects {

group "org.apache"

// def lucenePrereleaseBuild = '9'

// Repositories to fetch dependencies from.
repositories {
mavenCentral()
/* Reenable this if we need it again in future
maven {
name "LucenePrerelease${lucenePrereleaseBuild}"
url "https://nightlies.apache.org/solr/lucene-prereleases/${lucenePrereleaseBuild}/"
}
*/
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

// Artifacts will have names after full gradle project path
// so :solr:core will have solr-core.jar, etc.
Expand Down
6 changes: 2 additions & 4 deletions gradle/testing/randomization.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
// Configure test randomization seeds and derived test properties.
//

import java.nio.file.*
import com.carrotsearch.randomizedtesting.SeedUtils
import com.carrotsearch.randomizedtesting.generators.RandomPicks
import java.nio.file.Path
import org.apache.tools.ant.types.Commandline

buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.carrotsearch.randomizedtesting.runner
Expand Down
15 changes: 7 additions & 8 deletions gradle/validation/git-status.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@

// This verifies local git repository's status.

import org.eclipse.jgit.api.*
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
import org.eclipse.jgit.errors.*

import java.nio.file.FileVisitResult
import java.nio.file.Files
import java.nio.file.SimpleFileVisitor
import java.nio.file.Path
import java.nio.file.SimpleFileVisitor
import java.nio.file.attribute.BasicFileAttributes
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.errors.NoWorkTreeException
import org.eclipse.jgit.errors.NotSupportedException
import org.eclipse.jgit.errors.RepositoryNotFoundException
import org.eclipse.jgit.storage.file.FileRepositoryBuilder

buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.eclipse.jgit.jgit
Expand Down
4 changes: 1 addition & 3 deletions gradle/validation/jar-checks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def failOnError = true

// We're using commons-codec for computing checksums.
buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.commonscodec.commonscodec
Expand Down
4 changes: 1 addition & 3 deletions gradle/validation/rat-sources.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import groovy.xml.XmlSlurper
import org.eclipse.jgit.storage.file.FileRepositoryBuilder

buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.eclipse.jgit.jgit
Expand Down
5 changes: 1 addition & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
*/

pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
apply from: file("build-tools/build-infra/declare-repositories.gradle"), to: delegate

includeBuild("build-tools/build-infra")
}
Expand Down
8 changes: 3 additions & 5 deletions solr/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import java.util.regex.Matcher
import java.util.regex.Pattern
import org.apache.commons.codec.digest.DigestUtils
import org.gradle.process.ExecOperations
import javax.inject.Inject
import org.apache.commons.codec.digest.DigestUtils

description = 'Solr Docker image'

Expand Down Expand Up @@ -140,9 +139,8 @@ dependencies {

// We're using commons-codec for computing checksums.
buildscript {
repositories {
mavenCentral()
}
apply from: rootProject.file('build-tools/build-infra/declare-repositories.gradle'), to: delegate

dependencies {
classpath libs.commonscodec.commonscodec
}
Expand Down
3 changes: 2 additions & 1 deletion solr/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ repositories {
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
}
// mavenCentral / enterprise mirror, shared with the rest of the build.
apply(from = rootProject.file("build-tools/build-infra/declare-repositories.gradle"))

plugins {
alias(libs.plugins.kotlin.multiplatform)
Expand Down
Loading