美文网首页
java使用Gradle引入jar包

java使用Gradle引入jar包

作者: Uning | 来源:发表于2019-09-30 18:16 被阅读0次

    基础 Gradle 配置

    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 {
        compile 'org.springframework:spring-context'
        compile 'javax.persistence:javax.persistence-api'
        compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
        compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
        compile 'org.apache.commons:commons-lang3'
        //JWT
        compile 'io.jsonwebtoken:jjwt:0.9.1'
        compile 'io.jsonwebtoken:jjwt-extensions:0.10.7'
        //WEB
        compile 'org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE'
        //FAST JSON
        compile '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}") }
    }
    

    https://search.maven.org 搜索需要引入 jar 例如 fastJson 会在右边出来各类引用 url

    image.png

    相关文章

      网友评论

          本文标题:java使用Gradle引入jar包

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