This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

How do I set up the configuration of slf4j?

You need to add a under the directory of java test and then add the following snippets into your build.gradle file.

test {
systemProperty "log4j.configuration", ""
dependencies {
// or shadow

Please note that the second dependency shadow is not necessary if this dependency is already provided by other library. You can check the dependency tree by launching ./gradlew dependencies to see if it has been included.

If you encounter the error message like this: 

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

It means that no SLF4J binding is found. So you need to add or in build.gradle file.

How do I automatically format code and avoid spotless errors?


If it is just a simple runner like directRunner, all you need to do is to put your pipeline code under example folder, and then add following build target to the related build.gradle: 

task execute(type:JavaExec) {
main = "org.apache.beam.examples.SideInputWordCount"
classpath = configurations."directRunnerPreCommit"

There are also alternative choices, with slight difference: