1、maven转gradle的方法:在项目根目录下,使用命令行工具,输入如下内容:

gradle init --type.pom

2、springboot项目的 build.gradle内容示例如下(注意部分内容需要自己添加进去):

/*
* This file was generated by the Gradle 'init' task.
*/
buildscript {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE")
}

} apply plugin: 'java'
apply plugin: 'org.springframework.boot'
repositories {
mavenLocal()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
} dependencies {
compile 'org.springframework.boot:spring-boot-starter:2.1.6.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-web:2.1.6.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-undertow:2.1.6.RELEASE'
compile 'org.postgresql:postgresql:42.2.5'
compile 'com.baomidou:mybatis-plus-boot-starter:3.1.2'
compile 'com.alibaba:druid-spring-boot-starter:1.1.16'
compile 'org.springframework.security:spring-security-core:5.1.5.RELEASE'
compile 'org.springframework:spring-tx:5.1.8.RELEASE'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.commons:commons-collections4:4.1'
compile 'joda-time:joda-time:2.10.3'
compile 'com.spring4all:swagger-spring-boot-starter:1.8.0.RELEASE'
annotationProcessor 'org.projectlombok:lombok:1.18.8'
compileOnly 'org.projectlombok:lombok:1.18.8'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.8'
testCompileOnly 'org.projectlombok:lombok:1.18.8'

testCompile 'org.springframework.boot:spring-boot-starter-test:2.1.6.RELEASE'
} group = 'com.river'
version = '0.0.1-SNAPSHOT'
description = 'PostgrePlus'
sourceCompatibility = '1.8' tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

 3、打包:tasks->build->bootJar

  4、运行,找到项目build\libs对应的jar包,用java -jar XX.jar执行即可:

  

springboot maven项目转gradle的完整方法的更多相关文章

  1. eclipse 创建maven 项目 动态web工程完整示例

    需求表均同springmvc案例 此处只是使用maven 注意,以下所有需要建立在你的eclipse等已经集成配置好了maven了,说白了就是新建项目的时候已经可以找到maven了 没有的话需要安装m ...

  2. eclipse 创建maven 项目 动态web工程完整示例 maven 整合springmvc整合mybatis

    接上一篇: eclipse 创建maven 项目 动态web工程完整示例 eclipse maven工程自动添加依赖设置 maven工程可以在线搜索依赖的jar包,还是非常方便的 但是有的时候可能还需 ...

  3. springboot maven项目,为什么build成功,build path也没错误,project-->clean 也没用,项目上面还是有个红x呢?

    springboot maven项目,为什么build成功,build path也没错误,project-->clean 也没用,项目上面还是有个红x呢? 看错误信息有提示:  Descript ...

  4. 工具IDEA 配置springboot+maven项目

    工具IDEA 配置springboot+maven项目 首先安装IDEA,至于怎么安装就不介绍了.. 第一步 配置maven环境 首先安装maven,先在网上下载一个maven包.在IDEA的sett ...

  5. 构建maven项目,自定义目录结构方法

    构建maven项目 创建自定义的文件目录方法: 在项目名称右键-->Builder Path-->Configure Builder Path...Source菜单下的Add Folder ...

  6. eclipse 从git取项目,导入为maven项目,新加的方法,报加载主类错误

    eclipse 从git取项目,导入为maven项目,新加的方法,报加载主类错误 具体描述: 整体编译能够编译成功,但新加一个java,里面创建一个main方法,运行时,报无法加载主类的错误, 整体编 ...

  7. idea新建maven项目后生成web.xml方法和添加到tomcat方法

    idea新建maven项目后生成web.xml方法和添加到tomcat方法 参考:https://www.cnblogs.com/Liang-Haishan216/p/9302141.html 1.首 ...

  8. SpringBoot Maven项目 Helloworld 测试

    SpringBoot 化繁为简,简化配置 SpringBoot官方:http://projects.spring.io/spring-boot/SpringBoot使用介绍:http://blog.c ...

  9. Maven项目执行java入口main方法

    在Maven项目中配置pom.xml文件加载maven-surefire-plugin插件来执行testng.xml,相信大家对此种用法已经非常熟悉了.但是有些场景可能需要我们去加载执行java的ma ...

随机推荐

  1. yum lockfile is held by another process

    使用yum安装软件报错 yum lockfile is held by another process 解决方法 rm -f /var/run/yum.pid

  2. Debian9 安装软件汇总

    dpkg dpkg -i 安装本地安装包 echo 'pkgname newstat' | dpkg --set-selections 修改软件包安装状态 newstat install,deinst ...

  3. [无效]网络流之Edmond-Karp算法

    // 此博文为迁移而来,写于2015年2月2日,不代表本人现在的观点与看法.原始地址:http://blog.sina.com.cn/s/blog_6022c4720102vr12.html   UP ...

  4. spark基础知识一

    1. spark是什么 Apache Spark™ is a unified analytics engine for large-scale data processing. spark是针对于大规 ...

  5. K8s StatfulSet使用总结

    StatefulSet:在1.3以前K8s中StatefulSet叫PetSet(宠物集),由此也可看出StatefulSet是关注个体,而非群体. StatefulSet要满足以下几点: 稳定且唯一 ...

  6. vue自学小demo----前端

    vue学习的小demo,实现简单的页面项目的增删 代码如下 <!DOCTYPE html> <html> <head> <meta charset=" ...

  7. Computer-Hunters——团队展示

    Computer-Hunters--团队展示 这个作业属于哪个课程 https://edu.cnblogs.com/campus/fzu/2019FZUSEZ 这个作业要求在哪里 https://ed ...

  8. Debian使用小计

    1. Debian无法apt install debian安装完成后,如果运行apt install,提示 Media change: please insert the disc labeled ' ...

  9. 【RabbitMQ学习之二】RabbitMQ四种交换机模式应用

    环境 win7 rabbitmq-server-3.7.17 Erlang 22.1 一.概念1.队列队列用于临时存储消息和转发消息.队列类型有两种,即时队列和延时队列. 即时队列:队列中的消息会被立 ...

  10. 【Kubernetes学习之三】Kubernetes分布式集群架构

    环境 centos 7 一.Kubernetes分布式集群架构1.Kubernetes服务注册和服务发现问题怎么解决的?每个服务分配一个不变的虚拟IP+端口, 系统env环境变量里有每个服务的服务名称 ...