-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
131 lines (117 loc) · 3.71 KB
/
build.gradle
File metadata and controls
131 lines (117 loc) · 3.71 KB
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
plugins {
id 'idea'
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.10"
id 'io.spring.dependency-management' version '1.1.7'
id 'org.kordamp.gradle.profiles' version "0.54.0"
}
println("gradle version: ${gradle.gradleVersion}")
idea {
project {
settings {
encodings {
encoding = "UTF-8"
properties {
encoding = "UTF-8"
}
}
}
}
}
allprojects {
configurations.configureEach {
resolutionStrategy {
preferProjectModules()
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
}
subprojects { subproject ->
repositories {
mavenLocal()
// maven {
// url = project.properties["repository.public.url"] as String
// }
mavenCentral()
}
// Spring Boot BOM 기본 설정
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.2")
}
}
// profile 설정
profiles {
profile('snapshot') {
action {
project.version += '-SNAPSHOT'
}
}
}
plugins.withId('java') {
def javaVersion = properties.getOrDefault("jvm.version", 21) as int
java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(javaVersion))
// }
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
// compileJava {
// options.compilerArgs << "-Ajavadoc.packages=com.hunet"
// }
}
def artifactName = "${rootProject.name}-${project.name}"
plugins.withId('java-library') {
jar {
archiveBaseName = artifactName
archiveClassifier = ""
}
}
plugins.withId('maven-publish') {
println(" maven-publish plugin is enabled ${project.group}:${artifactName}:${project.version} jdk:${project.java.sourceCompatibility}")
// maven publish 할때 javadoc, sources 추가
javadoc {
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.charSet = "UTF-8"
copy {
from "src/main/docs"
into javadoc.destinationDir
}
}
subproject.publishing {
publications {
maven(MavenPublication) {
from components.java
//jar 파일인 경우 artifactId 변경
artifactId = artifactName
versionMapping {
allVariants {
fromResolutionResult()
}
}
java {
withSourcesJar()
}
}
}
/*repositories {
maven {
name = "nexus"
url = version.endsWith('-SNAPSHOT') ?
project.properties.get("repository.snapshot.url"):
project.properties.get("repository.release.url")
def nexusId = project.properties.getOrDefault('nexus.id', System.getenv('NEXUS_ID'))
def nexusPassword = project.properties.getOrDefault('nexus.password', System.getenv('NEXUS_PASSWORD'))
credentials {
username = nexusId
password = nexusPassword
}
}
}*/
}
}
}