加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 4.00 KB
一键复制 编辑 原始数据 按行查看 历史
shalousun 提交于 2021-05-29 13:43 . 升级gradle测试
buildscript {
ext {
springBootVersion = '2.3.4.RELEASE'
smartDocVersion = '2.1.8'
}
repositories {
maven { url 'http://localhost:8081/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('se.transmode.gradle:gradle-docker:1.2')
classpath("com.github.shalousun:smart-doc-gradle-plugin:${smartDocVersion}")
}
}
group 'com.power.doc'
version '1.0'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'docker'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'smart-doc'
smartdoc {
//
configFile = file("src/main/resources/smart-doc.json")
// exclude artifact
exclude 'org.springframework.boot:xx'
exclude 'org.springframework.boot:ddd'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
repositories {
maven { url 'http://localhost:8081/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}
configurations.compile {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.springframework.boot', module: 'logback-classic'
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.13.1'
compile('org.springframework.boot:spring-boot-starter') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.4'
compile 'com.alibaba:druid-spring-boot-starter:1.1.23'
compile 'mysql:mysql-connector-java:8.0.15'
compile('org.springframework.boot:spring-boot-starter-log4j2')
compile 'com.lmax:disruptor:3.4.2'
compile('org.springframework.boot:spring-boot-starter-aop')
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.74'
compile 'org.apache.commons:commons-lang3:3.9'
compile("org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}")
compile 'org.apache.commons:commons-text:1.8'
compile 'com.github.shalousun:common-util:2.0.4'
compileOnly 'org.projectlombok:lombok:1.18.0'
compile("com.github.shalousun:smart-doc-gradle-plugin:${smartDocVersion}")
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile 'com.github.shalousun:smart-doc:2.1.8'
}
task('copyConf', type: Copy) {
from "src/main/resources/"
into "build/package/${project.name}/config"
}
task('copyJar', type: Copy) {
from 'build/libs'
into "build/package/${project.name}/lib"
dependsOn('build')
}
task('copyBin', type: Copy) {
from 'src/main/scripts'
into "build/package/${project.name}/bin"
fileMode 0755
}
task('package', type: Tar) {
compression = Compression.GZIP
extension = 'tar.gz'
from "build/package"
mustRunAfter('clean')
dependsOn('clean', 'copyConf', 'copyJar', 'copyBin')
}
task buildDocker(type: Docker, dependsOn: build) {
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
tagVersion = "1.0"
doFirst {
copy {
from jar
into stageDir
}
}
}
//upload jar to nexus
def nexusUrl = "http://localhost:8081/nexus/content/repositories/releases/"
if (version.endsWith("-SNAPSHOT")) {
nexusUrl = "http://localhost:8081/nexus/content/repositories/snapshots/"
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: nexusUrl) {
authentication(userName: "admin", password: "admin123")
}
pom.version = "$project.version"
pom.artifactId = "$project.name"
pom.groupId = "$project.group"
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化