/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch 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.
 */

apply plugin: 'es.hadoop.build.base'
apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.apache.hadoop:hadoop-minikdc:${project.ext.minikdcVersion}") {
        // For some reason, the dependencies that are pulled in with MiniKDC have multiple resource files
        // that cause issues when they are loaded. We exclude the ldap schema data jar to get around this.
        exclude group: "org.apache.directory.api", module: "api-ldap-schema-data"
    }
}

// Target Java 1.8 compilation
java {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

// for testing, until fixture are actually debuggable.
// gradle hides EVERYTHING so you have no clue what went wrong.
task kdc(type: JavaExec) {
    classpath = sourceSets.main.compileClasspath + sourceSets.main.output
    mainClass = "org.elasticsearch.hadoop.test.fixture.minikdc.MiniKdcFixture"
    args = [ 'build/fixtures/miniKdcFixture' ]
}

test.enabled = false
