-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
137 lines (123 loc) · 4.35 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
buildscript {
repositories {
gradlePluginPortal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$sbVersion"
classpath "com.palantir.baseline:gradle-baseline-java:4.185.0"
classpath "io.spring.gradle:dependency-management-plugin:1.1.0"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.5.0.2730"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.12.1"
classpath 'org.owasp:dependency-check-gradle:7.4.4'
classpath "gradle.plugin.net.nemerosa:versioning:3.0.0"
}
}
subprojects {
group 'com.fortycoderplus.template'
version "1.0.0"
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'io.spring.dependency-management'
apply plugin: "net.nemerosa.versioning"
apply plugin: 'idea'
repositories {
mavenLocal()
maven {
credentials {
username "$nexusUsername"
password "$nexusPassword"
}
url "$nexusRelease"
}
maven {
credentials {
username "$nexusUsername"
password "$nexusPassword"
}
url "$nexusSnapshot"
}
mavenCentral()
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-starter-parent:${sbVersion}"
}
}
dependencies {
// lombok
compileOnly "org.projectlombok:lombok:1.18.24"
annotationProcessor "org.projectlombok:lombok:1.18.24"
// mapstruct
implementation 'org.mapstruct:mapstruct:1.5.2.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.2.Final'
// test:junit
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
plugins.withType(JavaPlugin) {
project.sourceCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
'Built-By': 'Codingendless',
'Build-Timestamp': DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()),
'Build-Revision': versioning.info.commit,
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.fortycoderplus.template'
artifactId = project.name
version = project.version
from components.java
pom {
name = "Gradle Multi Module Template"
description = 'Gradle Multi Module Template'
url = "${scmUrl}"
developers {
developer {
id = 'Codingendless'
name = 'Codingendless'
email = '[email protected]'
}
}
scm {
connection = "scm:git:${scmGit}"
url = "${scmUrl}"
}
}
}
}
repositories {
maven {
credentials {
username "$nexusUsername"
password "$nexusPassword"
}
url = version.endsWith('SNAPSHOT') ? "$nexusRelease" : "$nexusSnapshot"
allowInsecureProtocol = !url.toString().startsWith("https://")
}
}
}
}
apply from: 'baseline.gradle'
apply from: 'sonar.gradle'