![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
开发
缺氧�
这个作者很懒,什么都没留下…
展开
-
Gradle + SpringBoot + Swagger统一版本号维护
当我们在开发中需要维护版本号的时候就会发现,构建的时候有一个版本号。程序展示或者判断的时候又需要维护一个版本号,而两者原则上是一样的,为什么不能统一起来一起维护呢?没问题,上菜首先在构建脚本块中引用yaml类包buildscript { dependencies { classpath("org.yaml:snakeyaml:1.19") }}importimport org.yaml.snakeyaml.Yaml;编写任务,该任务脚本将Gradle中的名称、版本号、描述写入Spr原创 2021-03-18 16:15:29 · 431 阅读 · 1 评论 -
修复Windows Gradle长类路径问题。修复了JavaExec/Test任务出现错误的消息 “CreateProcess error=206, The filename or extension
buildscript { repositories { maven { url 'https://maven.aliyun.com/repository/gradle-plugin'} } dependencies { classpath('gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0') }}apply plugin: "ua.eshepelyuk.ManifestClasspath"原创 2021-03-03 15:01:19 · 176 阅读 · 1 评论 -
Gradle使用Docker插件创建镜像并推送仓库
Gradle有众多插件,而与Docker相关的插件也不止一个,这里应用的是bmuschko的Docker插件好处:用Gradle集成Docker,不用分开维护工程名称、版本号等其他信息,避免不必要的麻烦。而且构建、创建镜像、推送一气呵成。官方文档https://bmuschko.github.io/gradle-docker-plugin/首先Gradle需要5.2以上版本。其中有3个插件:com.bmuschko.docker-remote-api 自定义任务,操作空间最大com.bmus原创 2021-03-03 14:26:58 · 2182 阅读 · 0 评论 -
指定spring.profiles.active参数运行gradle run
build.gradle添加applicationDefaultJvmArgs = [ "-Dspring.profiles.active=${project.gradle.startParameter.systemPropertiesArgs['spring.profiles.active']}"]运行 gradle run -D'spring.profiles.active'=local原创 2021-02-26 12:34:05 · 443 阅读 · 0 评论