build.gradle 6.6 KB
Newer Older
1
plugins {
J
John Niang 已提交
2
    id "org.springframework.boot" version "2.5.0-M2"
RYAN0UP's avatar
RYAN0UP 已提交
3
    id "io.spring.dependency-management" version "1.0.11.RELEASE"
4 5
    id "checkstyle"
    id "java"
6 7
}

8
group = "run.halo.app"
RYAN0UP's avatar
RYAN0UP 已提交
9
version = "1.4.7-beta.1"
10
description = "Halo, An excellent open source blog publishing application."
J
John Niang 已提交
11
sourceCompatibility = JavaVersion.VERSION_11
12

J
John Niang 已提交
13 14 15 16 17 18
checkstyle {
    toolVersion = "8.39"
    showViolations = false
    ignoreFailures = false
}

19
repositories {
Z
zhixiangyuan 已提交
20
    mavenLocal()
21 22 23
//    maven {
//        url "https://maven.aliyun.com/nexus/content/groups/public"
//    }
24
    mavenCentral()
J
John Niang 已提交
25
    maven { url 'https://repo.spring.io/milestone' }
26
    jcenter()
27 28 29 30
}

configurations {
    implementation {
31 32
        exclude module: "spring-boot-starter-tomcat"
        exclude module: "slf4j-log4j12"
33
        exclude module: 'junit'
34
    }
35 36 37
    compileOnly {
        extendsFrom annotationProcessor
    }
38 39
}

40

41 42
bootJar {
    manifest {
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
        attributes "Implementation-Title": "Halo Application",
                "Implementation-Version": archiveVersion
    }
}

bootBuildImage.doFirst {
    // check data
    assert System.getenv("DOCKER_USERNAME") != null
    assert System.getenv("DOCKER_TOKEN") != null
}

bootBuildImage {
    // prepare data
    def tagLatest = Boolean.valueOf(System.getenv("TAG_LATEST"))
    def dockerImageName = System.getenv("DOCKER_IMAGE_NAME")
    def dockerUsername = System.getenv("DOCKER_USERNAME")
    def dockerToken = System.getenv("DOCKER_TOKEN")

    if (dockerImageName == null) {
        dockerImageName = "${dockerUsername}/halo"
    }
    if (!tagLatest) {
        dockerImageName = "${dockerImageName}:${project.version}"
    }

    // config plugin
    imageName = "${dockerImageName}"
    docker {
        publishRegistry {
            username = "${dockerUsername}"
            password = "${dockerToken}"
            email = "hi@halo.run"
        }
J
johnniang 已提交
76 77 78
    }
}

RYAN0UP's avatar
RYAN0UP 已提交
79
ext {
80 81 82 83 84 85
    hutoolVersion = "5.3.8"
    upyunSdkVersion = "4.2.0"
    qiniuSdkVersion = "7.2.29"
    aliyunSdkVersion = "3.9.1"
    baiduSdkVersion = "0.10.36"
    qcloudSdkVersion = "5.6.25"
86
    minioSdkVersion = "7.1.4"
J
John Niang 已提交
87
    swaggerVersion = "3.0.0"
J
johnwonder 已提交
88
    commonsFileUploadVersion = "1.4"
89 90 91
    commonsLangVersion = "3.10"
    httpclientVersion = "4.5.12"
    dataformatYamlVersion = "2.11.0"
92
    jgitVersion = "5.9.0.202009080501-r"
93
    flexmarkVersion = "0.62.2"
RYAN0UP's avatar
RYAN0UP 已提交
94
    thumbnailatorVersion = "0.4.13"
95
    image4jVersion = "0.7zensight1"
RYAN0UP's avatar
RYAN0UP 已提交
96
    flywayVersion = "7.5.1"
97
    h2Version = "1.4.197"
98
    levelDbVersion = "0.12"
99
    annotationsVersion = "3.0.1u2"
RYAN0UP's avatar
RYAN0UP 已提交
100
    zxingVersion = "3.4.0"
101
    huaweiObsVersion = "3.19.7"
B
BigBang019 已提交
102
    githubApiVersion = "1.84"
103
    templateInheritanceVersion = "0.4.RELEASE"
104
    jsoupVersion = "1.13.1"
RYAN0UP's avatar
RYAN0UP 已提交
105 106
}

107
dependencies {
B
BigBang019 已提交
108
    implementation "org.kohsuke:github-api:$githubApiVersion"
109 110 111
    implementation "org.springframework.boot:spring-boot-starter-actuator"
    implementation "org.springframework.boot:spring-boot-starter-data-jpa"
    implementation "org.springframework.boot:spring-boot-starter-web"
112
    implementation "org.springframework.boot:spring-boot-starter-jetty"
113
    implementation "org.springframework.boot:spring-boot-starter-freemarker"
114
    implementation 'org.springframework.boot:spring-boot-starter-validation'
115

116
    implementation "com.sun.mail:jakarta.mail"
117 118 119 120 121 122 123 124
    implementation "cn.hutool:hutool-core:$hutoolVersion"
    implementation "cn.hutool:hutool-crypto:$hutoolVersion"
    implementation "cn.hutool:hutool-extra:$hutoolVersion"
    implementation "com.upyun:java-sdk:$upyunSdkVersion"
    implementation "com.qiniu:qiniu-java-sdk:$qiniuSdkVersion"
    implementation "com.aliyun.oss:aliyun-sdk-oss:$aliyunSdkVersion"
    implementation "com.baidubce:bce-java-sdk:$baiduSdkVersion"
    implementation "com.qcloud:cos_api:$qcloudSdkVersion"
125
    implementation "com.huaweicloud:esdk-obs-java:$huaweiObsVersion"
126
    implementation "io.minio:minio:$minioSdkVersion"
J
John Niang 已提交
127
    implementation "io.springfox:springfox-boot-starter:$swaggerVersion"
J
johnwonder 已提交
128
    implementation "commons-fileupload:commons-fileupload:$commonsFileUploadVersion"
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
    implementation "org.apache.commons:commons-lang3:$commonsLangVersion"
    implementation "org.apache.httpcomponents:httpclient:$httpclientVersion"
    implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$dataformatYamlVersion"
    implementation "org.eclipse.jgit:org.eclipse.jgit:$jgitVersion"
    implementation "com.google.code.findbugs:annotations:$annotationsVersion"

    implementation "com.vladsch.flexmark:flexmark:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-attributes:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-autolink:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-emoji:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-escaped-character:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-gfm-tasklist:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-ins:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-media-tags:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-tables:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-toc:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-superscript:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-yaml-front-matter:$flexmarkVersion"
    implementation "com.vladsch.flexmark:flexmark-ext-gitlab:$flexmarkVersion"

150
    implementation "kr.pe.kwonnam.freemarker:freemarker-template-inheritance:$templateInheritanceVersion"
151 152 153
    implementation "net.coobird:thumbnailator:$thumbnailatorVersion"
    implementation "net.sf.image4j:image4j:$image4jVersion"
    implementation "org.flywaydb:flyway-core:$flywayVersion"
RYAN0UP's avatar
RYAN0UP 已提交
154
    implementation "com.google.zxing:core:$zxingVersion"
155 156 157 158 159 160 161 162 163 164 165

    implementation "org.iq80.leveldb:leveldb:$levelDbVersion"
    runtimeOnly "com.h2database:h2:$h2Version"
    runtimeOnly "mysql:mysql-connector-java"

    compileOnly "org.projectlombok:lombok"
    annotationProcessor "org.projectlombok:lombok"

    testCompileOnly "org.projectlombok:lombok"
    testAnnotationProcessor "org.projectlombok:lombok"

166 167 168
    testImplementation("org.springframework.boot:spring-boot-starter-test") {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
169
    testImplementation("org.jsoup:jsoup:${jsoupVersion}")
B
BigBang019 已提交
170

171
    developmentOnly "org.springframework.boot:spring-boot-devtools"
172
}
173 174 175

test {
    useJUnitPlatform()
J
John Niang 已提交
176
    testLogging.showStandardStreams = true
177
}
178 179 180 181 182 183 184

task projectVersion {
    description = 'Prints current project version.'
    doLast {
        println project.version
    }
}