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. BeyondCorps

    This repository provides a short description of the BeyondCorp security model and resources for impl ...

  2. 修改Discuz!X系列开启防CC攻击,不影响搜索引擎收录

    最近网站一直被攻击,特别是新上线的交流社区,所以今天写了一个开启CC攻击防护代码,而且不影响搜索引擎收录. 在config_global.php文件中有如下代码: $_config['security ...

  3. pycharm的Structure中的图标含义

    1.在使用pycharm的Structure时可以看到有这些图标.图标上的字母是简写,具体含义如下在pycharm中是自动补全的变量的类别  p:parameter 参数  m:method 方法   ...

  4. Problem B. 即时战略 ———2019.10.12

    题目:   代码~:感谢土蛋 #include <iostream> #include <cstring> #include <cmath> #include &l ...

  5. 去除批次效应 sva

    Surrogate Variable Analysis http://www.bioconductor.org/packages/release/bioc/html/sva.html

  6. Spring定时任务(@Scheduled)

    一.使用Spring的@Scheduled实现定时任务[1] 1.Spring配置文件xmlns加入 xmlns:task="http://www.springframework.org/s ...

  7. Redis NOAUTH Authentication required

    redis设置密码后停止服务报错,NOAUTH Authentication required 可以修改/etc/init.d/redis文件中的stop命令 $CLIEXEC -p $REDISPO ...

  8. 【原】无脑操作:Webstorm集成Git/Github

    Webstorm作为前端开发的主流工具,对Git及Github可以非常简便的集成. 1.开发环境:(如何安装就不说了) ① Webstorm 2018 ② git version 2.20.1 ③ G ...

  9. docker 学习操作记录 1

    记录1 Xshell (Build ) Copyright (c) NetSarang Computer, Inc. All rights reserved. Type `help' to learn ...

  10. 【java】获取客户端访问的公网ip和归属地

    import com.alibaba.druid.support.json.JSONUtils; import org.thymeleaf.util.StringUtils; import javax ...