jooq/jOOQ-examples/jOOQ-codegen-gradle
2014-02-03 17:59:38 +01:00
..
.settings Whitespace changes 2014-02-03 17:59:38 +01:00
example Whitespace changes 2014-02-03 17:59:38 +01:00
src/main Whitespace changes 2014-02-03 17:59:38 +01:00
.classpath Whitespace changes 2014-02-03 17:59:38 +01:00
.gitignore Whitespace changes 2014-02-03 17:59:38 +01:00
.project Whitespace changes 2014-02-03 17:59:38 +01:00
LICENSE.txt Whitespace changes 2014-02-03 17:59:38 +01:00
pom.xml Whitespace changes 2014-02-03 17:59:38 +01:00
README.md Whitespace changes 2014-02-03 17:59:38 +01:00

Gradle jOOQ Plugin

jOOQ generates a simple Java representation of your database schema. Every table, view, stored procedure, enum, UDT is a class. This plugin performs code generation as part of the Gradle build.

Usage

This plugin is hosted on the Maven Central Repository. All actions are logged at the info level.

The configuration is defined as an XML DSL based on jOOQ's codegen schema. The default target directory is updated to reflect Gradle's build directory (build/generated-sources/jooq).

apply plugin: 'jooq'

buildscript {
  repositories {
    mavenCentral()
  }
  
  dependencies {
    classpath "org.jooq:jooq-codegen-gradle:${versions.jOOQ}"
  }
}

jooq {
  jdbc {
    url 'jdbc:mysql://localhost:3306'
    driver 'com.mysql.jdbc.Driver'
    user 'root'
  }
  generator {
    database {
      name 'org.jooq.util.mysql.MySQLDatabase'
      inputSchema 'example'
      includes '.*'
    }
  }
}

Tasks

generateJooq

Executes the jOOQ code generator.