美文网首页
2,grade build.grade配置

2,grade build.grade配置

作者: 滔滔逐浪 | 来源:发表于2022-01-12 15:37 被阅读0次

compile,runtime,testCompile,testRuntime在gradle7.0版本中被删除。

上述的配置应分别改为implementation,runtimeOnly,testImplementation,和testRuntimeOnly。

导入jar例子:


plugins {
    id 'io.spring.dependency-management' version '1.0.5.RELEASE'
    id 'java'
}

ext { springBootVersion = '2.1.4.RELEASE' }

group 'com.og.auth'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework:spring-context'
    implementation 'javax.persistence:javax.persistence-api'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
    implementation 'org.apache.commons:commons-lang3'
    //JWT
    implementation 'io.jsonwebtoken:jjwt:0.9.1'
    implementation 'io.jsonwebtoken:jjwt-extensions:0.10.7'
    //WEB
    implementation 'org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE'
    //FAST JSON
    implementation 'com.alibaba:fastjson:1.2.60'
    compileOnly 'org.projectlombok:lombok'
    runtimeOnly 'mysql:mysql-connector-java'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

dependencyManagement {
    imports { mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") }
}


image.png

相关文章

网友评论

      本文标题:2,grade build.grade配置

      本文链接:https://www.haomeiwen.com/subject/qcmwcrtx.html