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

Commit f8b17d9

Browse files
authored
Merge pull request #552 from BlasiusSecundus/feature/maven-bom
feat: add Maven BOM for the project
2 parents 1cea297 + 6849d70 commit f8b17d9

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"
@@ -59,60 +63,62 @@ subprojects {
5963
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
6064
}
6165

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

68-
dependencies {
69-
compileOnly "org.projectlombok:lombok"
70-
annotationProcessor "org.projectlombok:lombok"
73+
dependencies {
74+
compileOnly "org.projectlombok:lombok"
75+
annotationProcessor "org.projectlombok:lombok"
7176

72-
testCompileOnly "org.projectlombok:lombok"
73-
testAnnotationProcessor "org.projectlombok:lombok"
74-
}
77+
testCompileOnly "org.projectlombok:lombok"
78+
testAnnotationProcessor "org.projectlombok:lombok"
79+
}
7580

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

91-
jacoco {
92-
toolVersion = "0.8.7-SNAPSHOT"
93-
}
96+
jacoco {
97+
toolVersion = "0.8.7-SNAPSHOT"
98+
}
9499

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

103-
idea {
104-
module {
105-
downloadJavadoc = true
106-
downloadSources = true
108+
idea {
109+
module {
110+
downloadJavadoc = true
111+
downloadSources = true
112+
}
107113
}
108-
}
109114

110-
compileJava {
111-
sourceCompatibility = SOURCE_COMPATIBILITY
112-
targetCompatibility = TARGET_COMPATIBILITY
113-
}
115+
compileJava {
116+
sourceCompatibility = SOURCE_COMPATIBILITY
117+
targetCompatibility = TARGET_COMPATIBILITY
118+
}
114119

115-
compileJava.dependsOn(processResources)
120+
compileJava.dependsOn(processResources)
121+
}
116122

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

@@ -121,19 +127,23 @@ subprojects {
121127
enabled = false
122128
}
123129

124-
jar {
125-
from "LICENSE.md"
126-
}
130+
if (it.name != bomProjectName) {
131+
jar {
132+
from "LICENSE.md"
133+
}
127134

128-
java {
129-
withSourcesJar()
130-
withJavadocJar()
135+
java {
136+
withSourcesJar()
137+
withJavadocJar()
138+
}
131139
}
132140

133141
publishing {
134142
publications {
135143
mainProjectPublication(MavenPublication) {
136-
from components.java
144+
if (project.name != bomProjectName) {
145+
from components.java
146+
}
137147

138148
// to avoid "Publication only contains dependencies and/or constraints without a version" error
139149
// 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)