123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- buildscript {
- repositories {
- maven { url 'https://maven.aliyun.com/repository/public' }
- gradlePluginPortal()
- }
- dependencies {
- //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here
- }
- }
- plugins {
- id "java"
- id "maven-publish"
- id "idea"
- id "eclipse"
- id "jacoco"
- id "org.springframework.boot"
- id "com.google.cloud.tools.jib"
- id "com.gorylenko.gradle-git-properties"
- id "org.liquibase.gradle"
- id "org.sonarqube"
- id "io.spring.nohttp"
- id "com.github.andygoossens.gradle-modernizer-plugin"
- //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
- id "org.springframework.boot.experimental.thin-launcher" version "1.0.28.RELEASE" apply false
- id "io.spring.dependency-management" version "1.0.13.RELEASE" apply false
- }
- group = "com.ruowei.trade"
- version = "0.0.1-SNAPSHOT"
- description = ""
- sourceCompatibility = 11
- targetCompatibility = 11
- assert System.properties["java.specification.version"] == "11" || "12" || "13" || "14" || "15" || "16" || "17" || "18"
- apply from: "gradle/docker.gradle"
- apply from: "gradle/sonar.gradle"
- //jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
- if (project.hasProperty("prod") || project.hasProperty("gae")) {
- apply from: "gradle/profile_prod.gradle"
- } else if (project.hasProperty("beta")) {
- apply from: "gradle/profile_beta.gradle"
- } else {
- apply from: "gradle/profile_dev.gradle"
- }
- if (project.hasProperty("war")) {
- apply from: "gradle/war.gradle"
- }
- if (project.hasProperty("gae")) {
- apply plugin: 'maven'
- apply plugin: 'org.springframework.boot.experimental.thin-launcher'
- apply plugin: 'io.spring.dependency-management'
- dependencyManagement {
- imports {
- mavenBom "tech.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}"
- }
- }
- appengineStage.dependsOn thinResolve
- }
- if (project.hasProperty("thin")) {
- apply from: "gradle/thin.gradle"
- bootJarMainClassName.dependsOn thinPom
- }
- idea {
- module {
- excludeDirs += files("node_modules")
- }
- }
- eclipse {
- sourceSets {
- main {
- java {
- srcDirs += ["build/generated/sources/annotationProcessor/java/main"]
- }
- }
- }
- }
- defaultTasks "bootRun"
- springBoot {
- mainClass = "com.ruowei.trade.TradeApp"
- }
- test {
- useJUnitPlatform()
- exclude "**/*IT*", "**/*IntTest*"
- testLogging {
- events 'FAILED', 'SKIPPED'
- }
- jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx512m'
- // uncomment if the tests reports are not generated
- // see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
- // ignoreFailures true
- reports.html.enabled = false
- }
- modernizer {
- failOnViolations = true
- includeTestClasses = true
- }
- check.dependsOn integrationTest
- task testReport(type: TestReport) {
- destinationDir = file("$buildDir/reports/tests")
- reportOn test
- }
- task integrationTestReport(type: TestReport) {
- destinationDir = file("$buildDir/reports/tests")
- reportOn integrationTest
- }
- if (!project.hasProperty("runList")) {
- project.ext.runList = "main"
- }
- project.ext.diffChangelogFile = "src/main/resources/config/liquibase/changelog/" + new Date().format("yyyyMMddHHmmss") + "_changelog.xml"
- liquibase {
- activities {
- main {
- driver "com.mysql.cj.jdbc.Driver"
- url "jdbc:mysql://localhost:3306/trade"
- username "root"
- password ""
- changeLogFile "src/main/resources/config/liquibase/master.xml"
- defaultSchemaName "trade"
- logLevel "debug"
- classpath "src/main/resources/"
- }
- diffLog {
- driver "com.mysql.cj.jdbc.Driver"
- url "jdbc:mysql://localhost:3306/trade"
- username "root"
- password ""
- changeLogFile project.ext.diffChangelogFile
- referenceUrl "hibernate:spring:com.ruowei.trade.domain?dialect=org.hibernate.dialect.MySQL8Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
- defaultSchemaName "trade"
- logLevel "debug"
- classpath "$buildDir/classes/java/main"
- }
- }
- runList = project.ext.runList
- }
- gitProperties {
- failOnNoGitDirectory = false
- keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
- }
- checkstyle {
- toolVersion "${checkstyleVersion}"
- configFile file("checkstyle.xml")
- checkstyleTest.enabled = false
- }
- nohttp {
- source.include "build.gradle", "README.md"
- }
- configurations {
- providedRuntime
- implementation.exclude module: "spring-boot-starter-tomcat"
- all {
- resolutionStrategy {
- // Inherited version from Spring Boot can't be used because of regressions:
- // To be removed as soon as spring-boot use the same version
- force 'org.liquibase:liquibase-core:4.15.0'
- }
- }
- }
- bootJar {
- baseName = "trade"
- version = ''
- }
- repositories {
- // Local maven repository is required for libraries built locally with maven like development jhipster-bom.
- mavenLocal()
- mavenCentral()
- maven { url 'https://maven.aliyun.com/repository/public' }
- maven { url "https://jitpack.io" }
- jcenter()
- google()
- //jhipster-needle-gradle-repositories - JHipster will add additional repositories
- }
- dependencies {
- // import JHipster dependencies BOM
- if (!project.hasProperty("gae")) {
- implementation platform("tech.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}")
- }
- // Use ", version: jhipsterDependenciesVersion, changing: true" if you want
- // to use a SNAPSHOT release instead of a stable release
- implementation group: "tech.jhipster", name: "jhipster-framework"
- implementation "javax.annotation:javax.annotation-api"
- implementation "org.springframework.boot:spring-boot-starter-cache"
- implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations"
- implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
- implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
- implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
- testImplementation "org.testcontainers:junit-jupiter"
- testImplementation "org.testcontainers:testcontainers"
- implementation("org.springdoc:springdoc-openapi-ui:1.6.11")
- implementation "com.zaxxer:HikariCP"
- implementation "org.apache.commons:commons-lang3"
- implementation "javax.cache:cache-api"
- implementation "org.ehcache:ehcache"
- implementation "org.hibernate:hibernate-jcache"
- annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
- implementation "org.hibernate:hibernate-core"
- implementation "org.hibernate.validator:hibernate-validator"
- implementation "org.liquibase:liquibase-core"
- liquibaseRuntime "org.liquibase:liquibase-core"
- annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
- implementation "org.springframework.boot:spring-boot-loader-tools"
- implementation "org.springframework.boot:spring-boot-starter-actuator"
- implementation "org.springframework.boot:spring-boot-starter-data-jpa"
- testImplementation "org.testcontainers:jdbc"
- implementation "org.springframework.boot:spring-boot-starter-logging"
- implementation "org.springframework.boot:spring-boot-starter-mail"
- implementation "org.springframework.boot:spring-boot-starter-security"
- implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
- implementation "org.springframework.boot:spring-boot-starter-web"
- testImplementation "org.springframework.boot:spring-boot-starter-test"
- testImplementation "org.springframework.boot:spring-boot-test"
- testImplementation "org.springframework.security:spring-security-test"
- testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}"
- testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}"
- implementation "org.zalando:problem-spring-web"
- implementation "org.springframework.boot:spring-boot-starter-undertow"
- implementation "io.jsonwebtoken:jjwt-api"
- if (!project.hasProperty("gae")) {
- runtimeOnly "io.jsonwebtoken:jjwt-impl"
- runtimeOnly "io.jsonwebtoken:jjwt-jackson"
- } else {
- implementation "io.jsonwebtoken:jjwt-impl"
- implementation "io.jsonwebtoken:jjwt-jackson"
- }
- implementation "org.springframework.security:spring-security-data"
- implementation "io.micrometer:micrometer-registry-prometheus"
- implementation "io.dropwizard.metrics:metrics-core"
- liquibaseRuntime sourceSets.main.compileClasspath
- liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibaseHibernate5Version}"
- //jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
- compileOnly "org.projectlombok:lombok:1.18.24"
- annotationProcessor "org.projectlombok:lombok:1.18.24"
- implementation "com.querydsl:querydsl-core:5.0.0"
- implementation "com.querydsl:querydsl-jpa:5.0.0"
- implementation "org.mapstruct:mapstruct:${mapstructVersion}"
- annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
- annotationProcessor "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
- annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jpa"
- implementation "com.github.xiaoymin:knife4j-springdoc-ui:3.0.3"
- implementation "com.github.wechatpay-apiv3:wechatpay-java:0.2.10"
- // ali-fastjson
- implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.83'
- // https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-core
- implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: '4.5.18'
- implementation "com.github.yitter:yitter-idgenerator:1.0.6"
- // MapperUtil
- implementation('org.modelmapper:modelmapper:1.1.0')
- // hutool
- implementation 'cn.hutool:hutool-all:5.8.10'
- // 依赖libs目录下所有以.jar结尾的文件
- implementation fileTree(dir: 'lib', includes: ['*.jar'])
- // 依赖某个jar文件
- // implementation files('lib/xxx.jar')
- // 依赖libs目录下除了xxx.jar以外的所有以.jar结尾的文件
- // implementation fileTree(dir: 'lib', excludes: ['xxx.jar'], includes: ['*.jar'])
- // compile fileTree(dir:'src/main/resources/lib',includes:['*jar'])
- // implementation fileTree(dir:'src/main/resources/lib',includes:['*jar'])
- }
- if (project.hasProperty("gae")) {
- task createPom {
- def basePath = 'build/resources/main/META-INF/maven'
- doLast {
- pom {
- withXml(dependencyManagement.pomConfigurer)
- }.writeTo("${basePath}/${project.group}/${project.name}/pom.xml")
- }
- }
- bootJar.dependsOn = [createPom]
- }
- task cleanResources(type: Delete) {
- delete "build/resources"
- }
- tasks.named("test").configure {
- enabled = false
- }
- tasks.named("integrationTest").configure {
- enabled = false
- }
- tasks.named("checkstyleMain").configure {
- enabled = false
- }
- wrapper {
- gradleVersion = "7.4.2"
- }
- compileJava.dependsOn processResources
- processResources.dependsOn bootBuildInfo
|