2.2K Star 11.1K Fork 3.4K

GVPbaomidou / mybatis-plus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 11.48 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
import java.time.LocalDateTime
allprojects {
group APP_GROUP
version APP_VERSION
}
ext {
configuration = [
javaVersion = JavaVersion.VERSION_21
]
libraries = [
mybatisVersion = '3.5.15',
mybatisSpringVersion = '2.1.2',
mybatisSpringBootStarterVersion = '2.3.1',
springVersion = '5.3.27',
springBootVersion = '2.7.15',
springBoot3Version = '3.2.0',
springCloudVersion = '3.1.8',
jsqlparserVersion = '4.6',
junitVersion = '5.9.0',
]
lib = [
"kotlin-reflect" : "org.jetbrains.kotlin:kotlin-reflect:1.9.22",
"kotlin-stdlib-jdk8" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.22",
"jsqlparser" : "com.github.jsqlparser:jsqlparser:${jsqlparserVersion}",
"mybatis" : "org.mybatis:mybatis:${mybatisVersion}",
"mybatis-spring" : "org.mybatis:mybatis-spring:${mybatisSpringVersion}",
"mybatis-thymeleaf" : "org.mybatis.scripting:mybatis-thymeleaf:1.0.4",
"mybatis-freemarker" : "org.mybatis.scripting:mybatis-freemarker:1.2.3",
"mybatis-velocity" : "org.mybatis.scripting:mybatis-velocity:2.1.2",
"spring-context-support" : "org.springframework:spring-context-support:${springVersion}",
"spring-jdbc" : "org.springframework:spring-jdbc:${springVersion}",
"spring-tx" : "org.springframework:spring-tx:${springVersion}",
"spring-web" : "org.springframework:spring-web:${springVersion}",
"spring-aop" : "org.springframework:spring-aop:${springVersion}",
"cglib" : "cglib:cglib:3.3.0",
"imadcn" : "com.imadcn.framework:idworker:1.5.0",
"spring-cloud-commons" : "org.springframework.cloud:spring-cloud-commons:${springCloudVersion}",
"javax.servlet-api" : "javax.servlet:javax.servlet-api:4.0.1",
"aspectjweaver" : "org.aspectj:aspectjweaver:1.9.21",
"slf4j-api" : "org.slf4j:slf4j-api:1.7.36",
//copy
"mybatis-spring-boot-starter": "org.mybatis.spring.boot:mybatis-spring-boot-starter:${mybatisSpringBootStarterVersion}",
//test
"spring-test" : "org.springframework:spring-test:${springVersion}",
"assertj-core" : "org.assertj:assertj-core:3.25.3",
"junit-jupiter" : "org.junit.jupiter:junit-jupiter:${junitVersion}",
"fastjson" : "com.alibaba:fastjson:2.0.44",
"jackson" : "com.fasterxml.jackson.core:jackson-databind:2.16.1",
"gson" : "com.google.code.gson:gson:2.9.1",
"lagarto" : "org.jodd:jodd-lagarto:6.0.6",
//datasource
"p6spy" : "p6spy:p6spy:3.9.1",
"sqlserver" : "com.microsoft.sqlserver:sqljdbc4:4.0",
"postgresql" : "org.postgresql:postgresql:42.7.1",
"oracle" : fileTree(dir: 'libs', includes: ['ojdbc8.jar']),
"dm" : fileTree(dir: 'libs', includes: ["jdbcDriver-18.jar"]),
"kingbase" : fileTree(dir: 'libs', includes: ["kingbase8-8.2.0.jar"]),
"h2" : "com.h2database:h2:2.2.224",
"mysql" : "mysql:mysql-connector-java:8.0.30",
"sqlite" : "org.xerial:sqlite-jdbc:3.44.1.0",
"firebird" : "org.firebirdsql.jdbc:jaybird:4.0.6.java8",
//cache
"mybatis-ehcache" : "org.mybatis.caches:mybatis-ehcache:1.2.3",
"mybatis-redis" : "org.mybatis.caches:mybatis-redis:1.0.0-beta2",
"mybatis-caffeine" : "org.mybatis.caches:mybatis-caffeine:1.0.0",
//code generator
"velocity" : "org.apache.velocity:velocity-engine-core:2.3",
"freemarker" : "org.freemarker:freemarker:2.3.32",
"beetl" : "com.ibeetl:beetl:3.15.13.RELEASE",
"swagger-annotations" : "io.swagger:swagger-annotations:1.6.12",
"enjoy" : "com.jfinal:enjoy:5.1.3",
"logback-classic" : "ch.qos.logback:logback-classic:1.4.11",
]
}
description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD操作"
subprojects {
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: "io.freefair.lombok"
apply plugin: 'com.github.hierynomus.license'
sourceCompatibility = "${javaVersion}"
targetCompatibility = "${javaVersion}"
lombok {
version = "1.18.30"
}
compileJava {
options.release = 8
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
}
dependencies {
testImplementation "${lib["assertj-core"]}"
testImplementation "${lib["junit-jupiter"]}"
testImplementation "org.mockito:mockito-junit-jupiter:5.6.0"
testImplementation "${lib["lagarto"]}"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.warnings = false
options.deprecation = true
options.compilerArgs += ["-parameters"]
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
jar {
into("META-INF/") {
from rootProject.file("LICENSE")
}
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenJavaPublication }
rename ".*", "pom.xml"
}
afterEvaluate {
manifest {
attributes 'Implementation-Title': archiveBaseName
attributes 'Implementation-Version': archiveVersion
attributes 'Built-Gradle': gradle.gradleVersion
attributes 'Bundle-DocURL': 'https://baomidou.com/'
attributes 'Build-OS': System.getProperty("os.name")
attributes 'Built-By': System.getProperty("user.name")
attributes 'Build-Jdk': System.getProperty("java.version")
attributes 'Build-Timestamp': LocalDateTime.now().format("yyyy-MM-dd HH:mm:ss")
attributes 'Automatic-Module-Name': "${project.group}.${project.name.replaceAll("-", ".")}"
}
}
}
// 控制台直接执行 `gradle licenseMain` 或者 `gradle licenseFormatMain`
// 前者是检查 main 源码的 licence 情况,后者是在 main 源码文件上 format license
// 因为不打算在 test 代码上添加 licence, 所以不使用 licenseTest 和 licenseFormatTest 这俩
license {
encoding = "UTF-8"
header = rootProject.file("license.txt")
includes(["**/*.java", "**/*.kt"])
mapping {
java = "SLASHSTAR_STYLE"
kt = "SLASHSTAR_STYLE"
}
ignoreFailures = true
ext.year = Calendar.getInstance().get(Calendar.YEAR)
}
//noinspection GroovyAssignabilityCheck
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
afterEvaluate {
configure(options) {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
failOnError false
links "http://docs.oracle.com/javase/8/docs/api"
}
}
}
test {
dependsOn("cleanTest", "generatePomFileForMavenJavaPublication")
useJUnitPlatform()
// 增加jvm参数不是一个很好的处理方案,最好还是只用java8下跑,下面只是兼容运行一下,但在高版本jdk下还有很多第三方反射库存在问题(等待完全升级)
// 部分测试用例如果需要在高版本java下运行用@EnabledOnJre
// 例如: https://github.com/cglib/cglib/issues/191
// if (JavaVersion.current().isJava9Compatible()) {
// jvmArgs += ["--add-opens", "java.base/java.lang=ALL-UNNAMED",
// "--add-opens", "java.base/java.util=ALL-UNNAMED",
// "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED"]
// }
exclude("**/phoenix/**")
exclude("**/postgresql/**")
// exclude("**/generator/**")
}
task cleanBuildDir(type: Delete) {
delete "${projectDir}/out"
}
tasks.clean.dependsOn(cleanBuildDir)
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
tasks.whenTaskAdded { task ->
if (task.name.contains('signMavenJavaPublication')) {
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
}
}
publishing {
repositories {
maven {
def userName = System.getProperty("un")
def passWord = System.getProperty("ps")
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username userName
password passWord
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'mybatis-plus'
packaging 'jar'
description = 'An enhanced toolkit of Mybatis to simplify development.'
url = 'https://github.com/baomidou/mybatis-plus'
scm {
connection = 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
developerConnection = 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
url = 'https://github.com/baomidou/mybatis-plus'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'baomidou'
name = 'hubin'
email = 'jobob@qq.com'
}
}
withXml {
def root = asNode()
root.dependencies.'*'.findAll {
def d = it
d.scope.text() == 'runtime' && project.configurations.findByName("implementation").allDependencies.find { dep ->
dep.name == it.artifactId.text()
}.each() {
d.scope*.value = 'compile'
d.appendNode('optional', true)
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
}
Java
1
https://gitee.com/baomidou/mybatis-plus.git
git@gitee.com:baomidou/mybatis-plus.git
baomidou
mybatis-plus
mybatis-plus
3.0

搜索帮助