-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
91 lines (78 loc) · 2.17 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import java.time.LocalDate
import java.time.format.DateTimeFormatter
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
}
}
apply plugin: 'java'
apply plugin: "io.spring.dependency-management"
apply plugin: 'maven-publish'
// project properties
group 'ru.reliabletech'
def libName = 'zuul-springfox-swagger'
version '0.3.1-SNAPSHOT'
sourceCompatibility = 1.8
def currentDate = LocalDate.now().format(DateTimeFormatter.ISO_DATE)
//tasks
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
task expandDescriptor(type: Copy) {
from 'descriptor.json'
into 'build'
expand(version: project.version, date: currentDate)
}
build.dependsOn expandDescriptor
compileJava.dependsOn(processResources)
// plugin settings
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
groupId project.group
artifactId libName
version project.version
}
}
}
jar {
manifest {
attributes(
"Group": group,
"Artifact-Id": libName,
"Version": version,
"Source-Compatibility": sourceCompatibility,
"Build-Time": currentDate
)
}
}
//dependency management
def springCloudVersion = 'Finchley.SR1'
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compileOnly 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
compileOnly 'org.springframework.cloud:spring-cloud-starter-netflix-zuul'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
implementation 'org.projectlombok:lombok:1.18.4'
compile 'io.springfox:springfox-swagger2:2.9.2'
compile 'io.springfox.ui:springfox-swagger-ui-rfc6570:1.0.0'
compileOnly 'org.springframework.boot:spring-boot-configuration-processor:1.5.9.RELEASE'
}