代码拉取完成,页面将自动刷新
buildscript {
ext {
jooqVersion = '3.13.4'
mysqlVersion = '5.1.45'
vjooqVersion = '4.3.0-SNAPSHOT'
flywayVersion = '5.2.4'
springBootPluginVersion = '2.1.9.RELEASE'
validationApiVersion='2.0.1.Final'
junitEngineVersion = '5.5.0'
// aspectjVersion = '1.9.4'
}
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
jcenter()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootPluginVersion")
classpath group: 'org.jooq', name: 'jooq-meta', version: '3.13.1'
classpath group: 'org.jooq', name: 'jooq-codegen', version: '3.13.1'
}
}
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'nu.studer.jooq' version '3.0.3'
id "org.flywaydb.flyway" version "5.2.4"
}
group = 'com.qimok.sharding'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
jcenter()
mavenCentral()
}
allprojects {
repositories {
maven {
name "aliyunmaven"
url "http://maven.aliyun.com/nexus/content/groups/public/"
}
}
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
substitute module('org.jooq:jooq') with module("org.jooq:jooq:$jooqVersion")
substitute module('org.jooq:jooq-codegen') with module("org.jooq:jooq-codegen:$jooqVersion")
substitute module('org.jooq:jooq-meta') with module("org.jooq:jooq-meta:$jooqVersion")
substitute module('javax.validation:validation-api') with module("javax.validation:validation-api:$validationApiVersion")
}
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jooq'
annotationProcessor 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok'
testCompile("org.junit.jupiter:junit-jupiter-api:$junitEngineVersion")
compile("org.springframework.boot:spring-boot-starter-test:$springBootPluginVersion")
compile group: 'org.apache.shardingsphere', name: 'sharding-jdbc-spring-boot-starter', version: '4.0.1'
compile("org.springframework.data:spring-data-commons:$springBootPluginVersion")
compile("org.springframework.boot:spring-boot-starter-validation:$springBootPluginVersion")
compile("mysql:mysql-connector-java:$mysqlVersion")
compile("org.flywaydb:flyway-core:$flywayVersion")
compile("org.aspectj:aspectjrt")
compile("org.aspectj:aspectjweaver")
}
// 如果使用了多个数据源,需要明确指出 Flyway 使用哪个数据源
flyway {
url = 'jdbc:mysql://110.gz.cdb.myqcloud.com:3450/sharding_jdbc_test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true'
locations = ['filesystem:src/main/resources/db/migration']
user = 'root'
password = '123456'
schemas = ['sharding_jdbc_test']
}
jooq {
version = jooqVersion
dependencies {
jooqRuntime("mysql:mysql-connector-java:$mysqlVersion")
// jooqRuntime("com.xxx:vjooq:$vjooqVersion") 依赖的是公司内部封装的插件
}
sample(sourceSets.main) {
def schema = 'sharding_jdbc_test'
jdbc {
driver = 'com.mysql.jdbc.Driver'
url = 'jdbc:mysql://110.gz.cdb.myqcloud.com:3450/sharding_jdbc_test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true'
user = 'root'
password = '123456'
}
generator {
name = 'org.jooq.codegen.DefaultGenerator'
strategy {
// name = 'com.xxx.jooq.DDDStrategy' 依赖的是公司内部封装的插件
}
database {
name = 'org.jooq.meta.mysql.MySQLDatabase'
inputSchema = schema
outputSchema = schema
includes = '.*'
excludes = 'flyway_schema_history|message_.*'
includeExcludeColumns = true
forcedTypes {
forcedType {
name = 'varchar'
expression = '.*'
types = 'JSONB?'
}
}
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = true
fluentSetters = true
}
target {
packageName = 'db'
directory = 'src/main/java'
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。