Skip to content
Closed
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
21 changes: 11 additions & 10 deletions plugins/examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import org.elasticsearch.gradle.VersionProperties

buildscript {
repositories {
maven {
url = 'https://snapshots.elastic.co/maven/'
repositories {
maven {
url = 'https://snapshots.elastic.co/maven/'
}
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${elasticsearchVersion}"
}
mavenCentral()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${elasticsearchVersion}"
}
}

subprojects {
Expand All @@ -25,13 +26,13 @@ subprojects {
maven {
url = 'https://snapshots.elastic.co/maven/'
mavenContent {
if (gradle.includedBuilds) {
if (gradle.includedBuilds || gradle.parent != null) {
// When building in a composite, restrict this to only resolve the Java REST client
includeModule 'co.elastic.clients', 'elasticsearch-java'
}
}
}
if (gradle.includedBuilds.isEmpty()) {
if (gradle.includedBuilds.isEmpty() && gradle.parent == null) {
maven {
url = "https://artifacts-snapshot.elastic.co/elasticsearch/${elasticsearchVersion}/maven"
mavenContent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.elasticsearch.example.customprocessor;

import org.elasticsearch.cluster.metadata.ProjectId;
import org.elasticsearch.ingest.AbstractProcessor;
import org.elasticsearch.ingest.ConfigurationUtils;
import org.elasticsearch.ingest.IngestDocument;
Expand Down Expand Up @@ -38,13 +39,13 @@ public String getType() {
}

public static class Factory implements Processor.Factory {

@Override
public ExampleRepeatProcessor create(
Map<String, Processor.Factory> registry,
String tag,
String description,
Map<String, Object> config
Map<String, Object> config,
ProjectId projectId
) {
String field = ConfigurationUtils.readStringProperty(TYPE, tag, config, FIELD_KEY_NAME);
return new ExampleRepeatProcessor(tag, description, field);
Expand Down
34 changes: 24 additions & 10 deletions plugins/examples/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
#
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the "Elastic License
# 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
# Public License v 1"; you may not use this file except in compliance with, at
# your election, the "Elastic License 2.0", the "GNU Affero General Public
# License v3.0 only", or the "Server Side Public License, v 1".
#
version=1.0.0-SNAPSHOT
group=org.elasticsearch.examples
org.gradle.welcome=never
org.gradle.warning.mode=none
org.gradle.parallel=true
# We need to declare --add-exports to make spotless working seamlessly with jdk16
org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -Xss2m --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED

# Enforce the build to fail on deprecated gradle api usage
systemProp.org.gradle.warning.mode=fail

# forcing to use TLS1.2 to avoid failure in vault
# see https://github.com/hashicorp/vault/issues/8750#issuecomment-631236121
systemProp.jdk.tls.client.protocols=TLSv1.2

# java homes resolved by environment variables
org.gradle.java.installations.auto-detect=false

# log some dependency verification info to console
org.gradle.dependency.verification.console=verbose

# allow user to specify toolchain via the RUNTIME_JAVA_HOME environment variable
org.gradle.java.installations.fromEnv=RUNTIME_JAVA_HOME

# if configuration cache enabled then enable parallel support too
org.gradle.configuration-cache.parallel=true
9 changes: 8 additions & 1 deletion plugins/examples/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ gradle.rootProject {
}

gradle.projectsEvaluated {
if (gradle.includedBuilds) {
if (gradle.includedBuilds || gradle.parent != null) {
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
includeBuild "../../build-tools"
}
gradle.allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
Expand Down