123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- ext {
- configuration = [
- javaVersion = JavaVersion.VERSION_17
- ]
- // 仓库配置
- repositories {
- mavenLocal()
- maven {
- allowInsecureProtocol = true
- url 'https://git.aizuda.com/api/packages/aizuda/maven'
- credentials(HttpHeaderCredentials) {
- name = "Authorization"
- value = "token 7d725429ef7ac5c9fa9a6779f70032d6e42d7f34"
- }
- authentication {
- header(HttpHeaderAuthentication)
- }
- }
- maven { url 'https://maven.aliyun.com/repository/central' }
- maven { url 'https://maven.aliyun.com/repository/spring' }
- mavenCentral()
- }
- }
- // 编译脚本
- buildscript {
- ext {
- springBootVersion = "3.1.1"
- springdocVersion = "2.5.0"
- mybatisPlusVersion = "3.5.9"
- flowlongVersion = "1.1.4"
- aizudaVersion = "1.0.2"
- }
- // 仓库配置
- repositories {
- mavenLocal()
- maven { url 'https://maven.aliyun.com/repository/central' }
- maven { url 'https://maven.aliyun.com/repository/spring' }
- mavenCentral()
- }
- dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
- }
- }
- apply plugin: 'java-library'
- apply plugin: "io.spring.dependency-management"
- apply plugin: 'org.springframework.boot'
- group = "com.aizuda"
- version = "1.0"
- description "爱组搭低代码组件化开发平台 Spring Boot 版本"
- sourceCompatibility = "${javaVersion}"
- targetCompatibility = "${javaVersion}"
- tasks.withType(JavaCompile) {
- options.encoding = "UTF-8"
- }
- configurations {
- all*.exclude module: "spring-boot-starter-logging"
- all*.exclude module: "spring-boot-starter-tomcat"
- }
- test {
- useJUnitPlatform()
- }
- // 依赖管理
- dependencyManagement {
- imports {
- mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
- mavenBom "com.baomidou:mybatis-plus-bom:${mybatisPlusVersion}"
- mavenBom "com.aizuda:aizuda-bom:1.0.3"
- }
- }
- dependencies {
- implementation("com.aizuda:aizuda-service-parent:${aizudaVersion}") {
- // 纯 mysql 运行环境打开该配置排除 PG 依赖
- // exclude group:"org.postgresql", module:"postgresql"
- }
- // mysql 驱动,纯 PG 环境可删除该依赖
- implementation("mysql:mysql-connector-java:8.0.33")
- // ORM
- implementation("com.baomidou:mybatis-plus-spring-boot3-starter")
- implementation("com.baomidou:mybatis-plus-jsqlparser")
- // SSO 单点登录
- implementation("com.baomidou:kisso:3.9.3")
- // 本地缓存
- implementation("com.github.ben-manes.caffeine:caffeine")
- // 代码生成
- implementation("com.aizuda:aizuda-generator:${aizudaVersion}")
- // 日志
- api("org.springframework.boot:spring-boot-starter-log4j2")
- api("com.lmax:disruptor")
- // 文档 https://springdoc.org
- implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdocVersion}")
- // 监控
- implementation("com.aizuda:aizuda-monitor")
- // 工作流引擎
- implementation("com.aizuda:flowlong-spring-boot-starter:${flowlongVersion}")
- // SpringBootAdmin 监控管理客户端,未使用可以删除
- // implementation("de.codecentric:spring-boot-admin-starter-client:3.0.2")
- // 电子邮件
- implementation("org.springframework.boot:spring-boot-starter-mail")
- // oss 文件存储
- implementation("com.aizuda:aizuda-oss")
- // implementation("io.minio:minio:8.5.10")
- implementation("com.squareup.okhttp3:okhttp:4.10.0")
- implementation("org.apache.tika:tika-core:2.7.0")
- compileOnly("p6spy:p6spy:3.9.1")
- testImplementation("p6spy:p6spy:3.9.1")
- compileOnly("org.projectlombok:lombok")
- annotationProcessor("org.projectlombok:lombok")
- testAnnotationProcessor("org.projectlombok:lombok")
- testCompileOnly("org.projectlombok:lombok")
- testImplementation("org.springframework.boot:spring-boot-starter-test")
- }
- // 执行 jar 命令编译
- jar {
- // 自定义 jar 任务以设置 MANIFEST.MF 配置分离 lib 加载
- manifest {
- attributes(
- 'Main-Class': 'com.aizuda.boot.BootApplication',
- 'Class-Path': configurations.runtimeClasspath.collect(({ "lib/${it.name}" } as Closure<Object>)).join(' ')
- )
- }
- }
- // 复制依赖到 lib 目录的任务
- tasks.register('copyLibs', Copy) {
- delete "$buildDir/libs/lib" // 删除历史包
- from configurations.runtimeClasspath
- into "$buildDir/libs/lib" // 输出到 build/libs/lib
- }
- // 仅在 jar 任务执行时,copyLibs 任务将被执行
- jar.finalizedBy(copyLibs)
|