Skip to content

Instantly share code, notes, and snippets.

@damondouglas
Created April 5, 2024 23:10
Show Gist options
  • Save damondouglas/5718b593b425b66bac5e563b9bc9f8dc to your computer and use it in GitHub Desktop.
Save damondouglas/5718b593b425b66bac5e563b9bc9f8dc to your computer and use it in GitHub Desktop.
Beam Gradle starter files.
plugins {
id("java")
// https://central.sonatype.com/artifact/com.diffplug.spotless/spotless-plugin-gradle/versions
id("com.diffplug.spotless") version "6.25.0"
}
// https://central.sonatype.com/artifact/com.google.auto.value/auto-value/versions
val autoValueVersion = "1.10.4"
// https://central.sonatype.com/artifact/org.apache.beam/beam-sdks-java-bom/versions
val beamVersion = "2.55.0"
// https://central.sonatype.com/artifact/org.junit.jupiter/junit-jupiter-api/versions
val jupiterVersion = "5.10.2"
// https://central.sonatype.com/artifact/org.slf4j/slf4j-simple/versions
val slf4jVersion = "2.0.12"
spotless {
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks {
withType<JavaCompile> {
options.compilerArgs.add("-Xlint:deprecation")
}
}
repositories {
mavenCentral()
maven {
// Required for Beam to resolve confluent dependency error
url = uri("https://packages.confluent.io/maven/")
}
}
dependencies {
implementation(platform("org.apache.beam:beam-sdks-java-bom:$beamVersion"))
implementation("org.apache.beam:beam-sdks-java-io-google-cloud-platform")
implementation("org.apache.beam:beam-sdks-java-core")
implementation("org.apache.beam:beam-runners-direct-java")
implementation("org.apache.beam:beam-runners-google-cloud-dataflow-java")
implementation("com.google.auto.value:auto-value:$autoValueVersion")
annotationProcessor("com.google.auto.value:auto-value:$autoValueVersion")
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$jupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
tasks.test {
useJUnitPlatform()
}
rootProject.name = "my-beam-project"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment