apply plugin: 'java'

repositories {
  mavenLocal()
  mavenCentral()
}

dependencies {
  implementation (
          'com.amazonaws.serverless:aws-serverless-java-container-jersey:[2.0-SNAPSHOT,)',
          'com.fasterxml.jackson.core:jackson-databind:2.19.1',
  )

  implementation("org.glassfish.jersey.media:jersey-media-json-jackson:3.1.10") {
    exclude group: 'com.fasterxml.jackson.core', module: "jackson-annotations"
    exclude group: 'com.fasterxml.jackson.core', module: "jackson-databind"
    exclude group: 'com.fasterxml.jackson.core', module: "jackson-core"
  }

  implementation("org.glassfish.jersey.inject:jersey-hk2:3.1.10") {
    exclude group: 'javax.inject', module: "javax.inject"
  }

  testImplementation("com.amazonaws.serverless:aws-serverless-java-container-core:[2.0-SNAPSHOT,):tests")
  testImplementation("org.apache.httpcomponents.client5:httpclient5:5.5")
  testImplementation(platform("org.junit:junit-bom:5.13.1"))
  testImplementation("org.junit.jupiter:junit-jupiter")
  testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

task buildZip(type: Zip) {
  from compileJava
  from processResources
  into('lib') {
    from configurations.compileClasspath
  }
}

test {
  useJUnitPlatform()
}

build.dependsOn buildZip
