/*
 * 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; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

apply plugin: 'elasticsearch.build'
apply plugin: 'com.gradleup.shadow'

// See the build.gradle file in the parent directory for an explanation of this unusual build

dependencies {
  implementation "com.nimbusds:nimbus-jose-jwt:10.0.2"
  implementation project(path: xpackModule('security:lib:nimbus-jose-jwt-modified-part2'), configuration: 'shadow')
}

tasks.named('shadowJar').configure {
  manifest {
    // The original library uses this and it gets stripped by shadowJar
    attributes 'Automatic-Module-Name': 'com.nimbusds.jose.jwt'
  }
}

['jarHell', 'thirdPartyAudit', 'forbiddenApisMain', 'splitPackagesAudit', 'licenseHeaders'].each {
  tasks.named(it).configure {
    enabled = false
  }
}
