Provide names for all artifact repositories (#41857)
This commit adds a name for each Maven and Ivy repository used in the build.
This commit is contained in:
parent
3a35427b6d
commit
d7fd51a84e
|
@ -6,6 +6,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
|
|||
settings.pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
name "artifactory-gradle-plugins"
|
||||
url "https://artifactory.elstc.co/artifactory/gradle-plugins"
|
||||
credentials {
|
||||
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
||||
|
@ -21,6 +22,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
|
|||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
name "artifactory-gradle-release"
|
||||
url "https://artifactory.elstc.co/artifactory/gradle-release/"
|
||||
credentials {
|
||||
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
||||
|
@ -31,6 +33,7 @@ if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFA
|
|||
}
|
||||
repositories {
|
||||
maven {
|
||||
name "artifactory-gradle-release"
|
||||
url "https://artifactory.elstc.co/artifactory/gradle-release/"
|
||||
credentials {
|
||||
username System.env.ELASTIC_ARTIFACTORY_USERNAME
|
||||
|
|
|
@ -88,7 +88,7 @@ subprojects {
|
|||
}
|
||||
repositories {
|
||||
maven {
|
||||
name = 'localTest'
|
||||
name = 'test'
|
||||
url = "${rootProject.buildDir}/local-test-repo"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ if (project != rootProject) {
|
|||
task integTest(type: Test) {
|
||||
// integration test requires the local testing repo for example plugin builds
|
||||
dependsOn project.rootProject.allprojects.collect {
|
||||
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
|
||||
it.tasks.matching { it.name == 'publishNebulaPublicationToTestRepository'}
|
||||
}
|
||||
dependsOn setupLocalDownloads
|
||||
exclude "**/*Tests.class"
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.gradle.api.artifacts.ModuleVersionIdentifier
|
|||
import org.gradle.api.artifacts.ProjectDependency
|
||||
import org.gradle.api.artifacts.ResolvedArtifact
|
||||
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||
import org.gradle.api.artifacts.repositories.ArtifactRepository
|
||||
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
|
||||
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
|
||||
import org.gradle.api.credentials.HttpHeaderCredentials
|
||||
|
@ -585,11 +586,11 @@ class BuildPlugin implements Plugin<Project> {
|
|||
project.getRepositories().all { repository ->
|
||||
if (repository instanceof MavenArtifactRepository) {
|
||||
final MavenArtifactRepository maven = (MavenArtifactRepository) repository
|
||||
assertRepositoryURIUsesHttps(project, maven.getUrl())
|
||||
assertRepositoryURIUsesHttps(maven, project, maven.getUrl())
|
||||
repository.getArtifactUrls().each { uri -> assertRepositoryURIUsesHttps(project, uri) }
|
||||
} else if (repository instanceof IvyArtifactRepository) {
|
||||
final IvyArtifactRepository ivy = (IvyArtifactRepository) repository
|
||||
assertRepositoryURIUsesHttps(project, ivy.getUrl())
|
||||
assertRepositoryURIUsesHttps(ivy, project, ivy.getUrl())
|
||||
}
|
||||
}
|
||||
RepositoryHandler repos = project.repositories
|
||||
|
@ -601,6 +602,7 @@ class BuildPlugin implements Plugin<Project> {
|
|||
}
|
||||
repos.jcenter()
|
||||
repos.ivy {
|
||||
name "elasticsearch"
|
||||
url "https://artifacts.elastic.co/downloads"
|
||||
patternLayout {
|
||||
artifact "elasticsearch/[module]-[revision](-[classifier]).[ext]"
|
||||
|
@ -629,9 +631,9 @@ class BuildPlugin implements Plugin<Project> {
|
|||
}
|
||||
}
|
||||
|
||||
private static void assertRepositoryURIUsesHttps(final Project project, final URI uri) {
|
||||
private static void assertRepositoryURIUsesHttps(final ArtifactRepository repository, final Project project, final URI uri) {
|
||||
if (uri != null && uri.toURL().getProtocol().equals("http")) {
|
||||
throw new GradleException("repository on project with path [${project.path}] is using http for artifacts on [${uri.toURL()}]")
|
||||
throw new GradleException("repository [${repository.name}] on project with path [${project.path}] is using http for artifacts on [${uri.toURL()}]")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -174,6 +174,7 @@ class VagrantTestPlugin implements Plugin<Project> {
|
|||
which should work for 5.0.0+. This isn't a real ivy repository but gradle
|
||||
is fine with that */
|
||||
repos.ivy {
|
||||
name "elasticsearch"
|
||||
artifactPattern "https://artifacts.elastic.co/downloads/elasticsearch/[module]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ public class BuildExamplePluginsIT extends GradleIntegrationTestCase {
|
|||
"buildscript {\n" +
|
||||
" repositories {\n" +
|
||||
" maven {\n" +
|
||||
" name = \"test\"\n" +
|
||||
" url = '" + getLocalTestRepoPath() + "'\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
|
@ -117,12 +118,14 @@ public class BuildExamplePluginsIT extends GradleIntegrationTestCase {
|
|||
String luceneSnapshotRevision = System.getProperty("test.lucene-snapshot-revision");
|
||||
if (luceneSnapshotRepo != null) {
|
||||
luceneSnapshotRepo = " maven {\n" +
|
||||
" name \"lucene-snapshots\"\n" +
|
||||
" url \"https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/" + luceneSnapshotRevision + "\"\n" +
|
||||
" }\n";
|
||||
}
|
||||
writeBuildScript("\n" +
|
||||
"repositories {\n" +
|
||||
" maven {\n" +
|
||||
" name \"test\"\n" +
|
||||
" url \"" + getLocalTestRepoPath() + "\"\n" +
|
||||
" }\n" +
|
||||
" flatDir {\n" +
|
||||
|
|
|
@ -16,6 +16,7 @@ repositories {
|
|||
jcenter()
|
||||
repositories {
|
||||
maven {
|
||||
name "local-repo"
|
||||
url System.getProperty("local.repo.path")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ repositories {
|
|||
jcenter()
|
||||
repositories {
|
||||
maven {
|
||||
name "local"
|
||||
url System.getProperty("local.repo.path")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,13 @@ allprojects { all ->
|
|||
dir System.getProperty("test.local-test-downloads-path")
|
||||
}
|
||||
maven {
|
||||
name "local"
|
||||
url System.getProperty("local.repo.path")
|
||||
}
|
||||
String luceneSnapshotRevision = System.getProperty("test.lucene-snapshot-revision")
|
||||
if (luceneSnapshotRevision != null) {
|
||||
maven {
|
||||
name "lucene-snapshots"
|
||||
url "https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/" + luceneSnapshotRevision
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ repositories {
|
|||
* - version 0.0.2 has the same class and one extra file just to make the jar different
|
||||
*/
|
||||
maven {
|
||||
name = "local-test"
|
||||
url = file("sample_jars/build/testrepo")
|
||||
}
|
||||
jcenter()
|
||||
|
|
|
@ -237,6 +237,7 @@ String hash = jdkVersionMatcher.group(4)
|
|||
repositories {
|
||||
// simpler legacy pattern from JDK 9 to JDK 12 that we are advocating to Oracle to bring back
|
||||
ivy {
|
||||
name "legacy-jdk"
|
||||
url "https://download.oracle.com"
|
||||
metadataSources {
|
||||
artifact()
|
||||
|
@ -247,6 +248,7 @@ repositories {
|
|||
}
|
||||
// current pattern since 12.0.1
|
||||
ivy {
|
||||
name "jdk"
|
||||
url "https://download.oracle.com"
|
||||
metadataSources {
|
||||
artifact()
|
||||
|
|
|
@ -53,6 +53,7 @@ import java.util.regex.Pattern
|
|||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
name "gradle-plugins"
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ For Gradle:
|
|||
["source","groovy",subs="attributes"]
|
||||
--------------------------------------------------
|
||||
maven {
|
||||
name "lucene-snapshots"
|
||||
url 'https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9'
|
||||
}
|
||||
--------------------------------------------------
|
||||
|
|
|
@ -104,6 +104,7 @@ For Gradle:
|
|||
["source","groovy",subs="attributes"]
|
||||
--------------------------------------------------
|
||||
maven {
|
||||
name 'lucene-snapshots'
|
||||
url 'https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/83f9835'
|
||||
}
|
||||
--------------------------------------------------
|
||||
|
|
|
@ -65,6 +65,7 @@ repositories {
|
|||
|
||||
// Add the Elasticsearch Maven Repository
|
||||
maven {
|
||||
name "elastic"
|
||||
url "https://artifacts.elastic.co/maven"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,11 @@ subprojects { Project subproj ->
|
|||
*/
|
||||
repositories {
|
||||
maven {
|
||||
name "elastic"
|
||||
url "https://artifacts.elastic.co/maven"
|
||||
}
|
||||
maven {
|
||||
name "elastic-snapshots"
|
||||
url "https://snapshots.elastic.co/maven"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ int managementPort
|
|||
repositories {
|
||||
// the Wildfly distribution is not available via a repository, so we fake an Ivy repository on top of the download site
|
||||
ivy {
|
||||
name "wildfly"
|
||||
url "https://download.jboss.org"
|
||||
metadataSources {
|
||||
artifact()
|
||||
|
|
|
@ -60,6 +60,7 @@ repositories {
|
|||
|
||||
// Add the Elasticsearch Maven Repository
|
||||
maven {
|
||||
name "elastic"
|
||||
url "https://artifacts.elastic.co/maven"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ esplugin {
|
|||
|
||||
repositories {
|
||||
ivy {
|
||||
name "prelert-artifacts"
|
||||
name "ml-cpp"
|
||||
url "https://prelert-artifacts.s3.amazonaws.com"
|
||||
metadataSources {
|
||||
// no repository metadata, look directly for the artifact
|
||||
|
|
|
@ -145,9 +145,11 @@ project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackRestSpec)
|
|||
|
||||
repositories {
|
||||
maven {
|
||||
name "elastic"
|
||||
url "https://artifacts.elastic.co/maven"
|
||||
}
|
||||
maven {
|
||||
name "elastic-snapshots"
|
||||
url "https://snapshots.elastic.co/maven"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue