Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 6849d70

Browse files
feat: add Maven BOM for the project
1 parent 9dc6d2e commit 6849d70

File tree

3 files changed

+97
-54
lines changed

3 files changed

+97
-54
lines changed

build.gradle

Lines changed: 64 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ sonarqube {
3737
}
3838
}
3939

40+
def bomProjectName = "graphql-spring-boot-dependencies"
41+
4042
subprojects {
4143
apply plugin: 'idea'
42-
apply plugin: 'jacoco'
43-
apply plugin: 'org.sonarqube'
44-
apply plugin: 'java'
45-
apply plugin: 'java-library'
44+
if (it.name != bomProjectName) {
45+
apply plugin: 'jacoco'
46+
apply plugin: 'org.sonarqube'
47+
apply plugin: 'java'
48+
apply plugin: 'java-library'
49+
apply plugin: "io.spring.dependency-management"
50+
}
4651
apply plugin: 'maven-publish'
4752
apply plugin: "com.jfrog.bintray"
48-
apply plugin: "io.spring.dependency-management"
4953
apply plugin: 'com.jfrog.artifactory'
5054

5155
group "$PROJECT_GROUP"
@@ -60,60 +64,62 @@ subprojects {
6064
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
6165
}
6266

63-
dependencyManagement {
64-
imports {
65-
mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
67+
if (it.name != bomProjectName) {
68+
dependencyManagement {
69+
imports {
70+
mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
71+
}
6672
}
67-
}
6873

69-
dependencies {
70-
compileOnly "org.projectlombok:lombok"
71-
annotationProcessor "org.projectlombok:lombok"
74+
dependencies {
75+
compileOnly "org.projectlombok:lombok"
76+
annotationProcessor "org.projectlombok:lombok"
7277

73-
testCompileOnly "org.projectlombok:lombok"
74-
testAnnotationProcessor "org.projectlombok:lombok"
75-
}
78+
testCompileOnly "org.projectlombok:lombok"
79+
testAnnotationProcessor "org.projectlombok:lombok"
80+
}
7681

77-
test {
78-
useJUnitPlatform()
79-
testLogging {
80-
events TestLogEvent.FAILED,
81-
TestLogEvent.PASSED,
82-
TestLogEvent.SKIPPED,
83-
TestLogEvent.STANDARD_ERROR,
84-
TestLogEvent.STANDARD_OUT
85-
exceptionFormat TestExceptionFormat.FULL
86-
showCauses true
87-
showExceptions true
88-
showStackTraces true
82+
test {
83+
useJUnitPlatform()
84+
testLogging {
85+
events TestLogEvent.FAILED,
86+
TestLogEvent.PASSED,
87+
TestLogEvent.SKIPPED,
88+
TestLogEvent.STANDARD_ERROR,
89+
TestLogEvent.STANDARD_OUT
90+
exceptionFormat TestExceptionFormat.FULL
91+
showCauses true
92+
showExceptions true
93+
showStackTraces true
94+
}
8995
}
90-
}
9196

92-
jacoco {
93-
toolVersion = "0.8.7-SNAPSHOT"
94-
}
97+
jacoco {
98+
toolVersion = "0.8.7-SNAPSHOT"
99+
}
95100

96-
jacocoTestReport {
97-
reports {
98-
xml.enabled = true
99-
html.enabled = false
100-
csv.enabled = false
101+
jacocoTestReport {
102+
reports {
103+
xml.enabled = true
104+
html.enabled = false
105+
csv.enabled = false
106+
}
101107
}
102-
}
103108

104-
idea {
105-
module {
106-
downloadJavadoc = true
107-
downloadSources = true
109+
idea {
110+
module {
111+
downloadJavadoc = true
112+
downloadSources = true
113+
}
108114
}
109-
}
110115

111-
compileJava {
112-
sourceCompatibility = SOURCE_COMPATIBILITY
113-
targetCompatibility = TARGET_COMPATIBILITY
114-
}
116+
compileJava {
117+
sourceCompatibility = SOURCE_COMPATIBILITY
118+
targetCompatibility = TARGET_COMPATIBILITY
119+
}
115120

116-
compileJava.dependsOn(processResources)
121+
compileJava.dependsOn(processResources)
122+
}
117123

118124
if (!it.name.startsWith('example')) {
119125

@@ -122,19 +128,23 @@ subprojects {
122128
enabled = false
123129
}
124130

125-
jar {
126-
from "LICENSE.md"
127-
}
131+
if (it.name != bomProjectName) {
132+
jar {
133+
from "LICENSE.md"
134+
}
128135

129-
java {
130-
withSourcesJar()
131-
withJavadocJar()
136+
java {
137+
withSourcesJar()
138+
withJavadocJar()
139+
}
132140
}
133141

134142
publishing {
135143
publications {
136144
mainProjectPublication(MavenPublication) {
137-
from components.java
145+
if (project.name != bomProjectName) {
146+
from components.java
147+
}
138148

139149
// to avoid "Publication only contains dependencies and/or constraints without a version" error
140150
// see https://docs.gradle.org/6.2.1/userguide/publishing_maven.html#publishing_maven:resolved_dependencies
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apply plugin: "java-platform"
2+
3+
dependencies {
4+
constraints {
5+
api "com.graphql-java:graphql-java-extended-scalars:$LIB_EXTENDED_SCALARS_VERSION"
6+
api "com.graphql-java:graphql-java:$LIB_GRAPHQL_JAVA_VER"
7+
api "com.graphql-java-kickstart:graphql-java-servlet:$LIB_GRAPHQL_SERVLET_VER"
8+
api "com.graphql-java-kickstart:graphql-java-kickstart:$LIB_GRAPHQL_SERVLET_VER"
9+
api "com.graphql-java-kickstart:graphql-java-tools:$LIB_GRAPHQL_JAVA_TOOLS_VER"
10+
api "io.github.graphql-java:graphql-java-annotations:$LIB_GRAPHQL_ANNOTATIONS_VER"
11+
api project(":graphql-spring-boot-starter")
12+
runtime project(":altair-spring-boot-starter")
13+
runtime project(":graphiql-spring-boot-starter")
14+
runtime project(":voyager-spring-boot-starter")
15+
runtime project(":playground-spring-boot-starter")
16+
api project(":graphql-spring-boot-starter-test")
17+
api project(":graphql-kickstart-spring-boot-starter-webflux")
18+
api project(":graphql-kickstart-spring-boot-starter-tools")
19+
api project(":graphql-kickstart-spring-boot-starter-graphql-annotations")
20+
}
21+
}
22+
23+
publishing {
24+
publications {
25+
mainProjectPublication(MavenPublication) {
26+
from components.javaPlatform
27+
}
28+
}
29+
}
30+
31+

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ include ":voyager-spring-boot-starter"
3838
include ":playground-spring-boot-autoconfigure"
3939
include ":playground-spring-boot-starter"
4040

41+
include ':graphql-spring-boot-dependencies'
42+
4143
include ':graphql-kickstart-spring-boot-autoconfigure-graphql-annotations'
4244
include ':graphql-kickstart-spring-boot-starter-graphql-annotations'
4345
include ':graphql-kickstart-spring-boot-autoconfigure-tools'

0 commit comments

Comments
 (0)