Development versions: 3.12

Whitespace (newlines and indentation)

By default, jOOQ's code generator produces unix newline characters (\n) and 4 space indentation (Java) or 2 space indentation (Scala). This can be overridden by using the following configuration flags:

XML configuration (standalone and Maven)

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
  <generator>
    <generate>
      <indentation>  </indentation>
      <newline>\n</newline>
    </generate>
  </generator>
</configuration>

Programmatic configuration

configuration
  .withGenerator(new Generator(
    .withGenerate(new Generate()
      .withIndentation("  ")
      .withNewline("\n"))));

Gradle configuration

myConfigurationName(sourceSets.main) {
  generator {
    generate {
      indentation = '  '
      newline = '\n'
    }
  }
}
The jOOQ Logo