maven -> gradle

将maven 切换成 gradle

./gradlew init --type=pom

//选择groovy

//build.gradle
plugins {
    id 'java'
    id 'org.springframework.boot' version '2.5.5'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'

}
apply plugin: "maven-publish"
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
    mavenLocal()
    maven {
        allowInsecureProtocol = true
        url = uri('https://maven.aliyun.com/nexus/content/groups/public/')
    }

    maven {
        allowInsecureProtocol = true
        url = uri('https://repo.maven.apache.org/maven2/')
    }
}

dependencies {
    implementation 'com.google.code.bean-matchers:bean-matchers:0.13'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
//    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
    //该依赖自己制作的依赖,因此我将其复制到了根路径下的libs中
//    implementation 'liyuan.user:base-jwt-security:1.0-SNAPSHOT'
    implementation fileTree(dir: "libs",includes: ["*.jar"])
    implementation 'mysql:mysql-connector-java:8.0.16'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'com.alibaba:fastjson:1.2.73'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'
    implementation "org.springframework.boot:spring-boot-starter-amqp"

    implementation 'io.springfox:springfox-swagger2:2.9.2'
    implementation 'com.pig4cloud.plugin:knife4j-spring-ui:3.0.2'
    implementation 'io.swagger:swagger-annotations:1.5.20'


}

test {
    useJUnitPlatform()
}
//

ext {
    registryUrl = "1.116.38.204"
}
apply plugin: 'idea'


//docker {
//    url = "http://1.116.38.204:2375"
//    url.set("tcp:1.116.38.204:2375")
//
    SpringBootApplication{
        baseImage = "java:8"
        maintainer="liyuan"
        ports = [8080]
        images = ["${registryUrl}/gdufs-lib/${rootProject.name}:${version}"]
        jvmArgs=["-Dspring.profiles.active=pro"]
    }
//}
//
tasks.withType(JavaCompile) {
    options.encoding = "utf-8"
}

// build.gradle.kts
/*
 * This file was generated by the Gradle 'init' task.
 */

plugins {
    java
    `maven-publish`
}
val localRepo = "file://" + File("E:\\m2").absoluteFile

repositories {
    maven(localRepo)
    maven(url = "https://maven.aliyun.com/repository/jcenter")
    mavenCentral()
}


dependencies {
    implementation("org.springframework.boot:spring-boot-starter-web:2.3.2.RELEASE")
    implementation("org.springframework.boot:spring-boot-starter-security:2.3.2.RELEASE")
    implementation("org.springframework.boot:spring-boot-devtools:2.3.2.RELEASE")
    implementation("org.springframework.boot:spring-boot-configuration-processor:2.3.2.RELEASE")
    implementation("com.alibaba:fastjson:1.2.73")
    implementation("org.springframework.security:spring-security-jwt:1.0.11.RELEASE")

    testImplementation("junit:junit:4.13")
}

group = "liyuan.jwt"
version = "1.0-SNAPSHOT"
description = "jwt-security"
java.sourceCompatibility = JavaVersion.VERSION_1_8

publishing {
    publications.create<MavenPublication>("maven") {
        from(components["java"])
    }
}

tasks.withType<JavaCompile>() {
    options.encoding = "utf-8"
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值