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

feat: add Maven BOM for the project #552

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 64 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ sonarqube {
}
}

def bomProjectName = "graphql-spring-boot-dependencies"

subprojects {
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
apply plugin: 'java'
apply plugin: 'java-library'
if (it.name != bomProjectName) {
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: "io.spring.dependency-management"
}
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.bintray"
apply plugin: "io.spring.dependency-management"
apply plugin: 'com.jfrog.artifactory'

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

dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
if (it.name != bomProjectName) {
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
}
}
}

dependencies {
compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
dependencies {
compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"

testCompileOnly "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
}
testCompileOnly "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
}

test {
useJUnitPlatform()
testLogging {
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showCauses true
showExceptions true
showStackTraces true
test {
useJUnitPlatform()
testLogging {
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showCauses true
showExceptions true
showStackTraces true
}
}
}

jacoco {
toolVersion = "0.8.7-SNAPSHOT"
}
jacoco {
toolVersion = "0.8.7-SNAPSHOT"
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
csv.enabled = false
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
csv.enabled = false
}
}
}

idea {
module {
downloadJavadoc = true
downloadSources = true
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
}

compileJava {
sourceCompatibility = SOURCE_COMPATIBILITY
targetCompatibility = TARGET_COMPATIBILITY
}
compileJava {
sourceCompatibility = SOURCE_COMPATIBILITY
targetCompatibility = TARGET_COMPATIBILITY
}

compileJava.dependsOn(processResources)
compileJava.dependsOn(processResources)
}

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

Expand All @@ -122,19 +128,23 @@ subprojects {
enabled = false
}

jar {
from "LICENSE.md"
}
if (it.name != bomProjectName) {
jar {
from "LICENSE.md"
}

java {
withSourcesJar()
withJavadocJar()
java {
withSourcesJar()
withJavadocJar()
}
}

publishing {
publications {
mainProjectPublication(MavenPublication) {
from components.java
if (project.name != bomProjectName) {
from components.java
}

// to avoid "Publication only contains dependencies and/or constraints without a version" error
// see https://docs.gradle.org/6.2.1/userguide/publishing_maven.html#publishing_maven:resolved_dependencies
Expand Down
31 changes: 31 additions & 0 deletions graphql-spring-boot-dependencies/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apply plugin: "java-platform"

dependencies {
constraints {
api "com.graphql-java:graphql-java-extended-scalars:$LIB_EXTENDED_SCALARS_VERSION"
api "com.graphql-java:graphql-java:$LIB_GRAPHQL_JAVA_VER"
api "com.graphql-java-kickstart:graphql-java-servlet:$LIB_GRAPHQL_SERVLET_VER"
api "com.graphql-java-kickstart:graphql-java-kickstart:$LIB_GRAPHQL_SERVLET_VER"
api "com.graphql-java-kickstart:graphql-java-tools:$LIB_GRAPHQL_JAVA_TOOLS_VER"
api "io.github.graphql-java:graphql-java-annotations:$LIB_GRAPHQL_ANNOTATIONS_VER"
api project(":graphql-spring-boot-starter")
runtime project(":altair-spring-boot-starter")
runtime project(":graphiql-spring-boot-starter")
runtime project(":voyager-spring-boot-starter")
runtime project(":playground-spring-boot-starter")
api project(":graphql-spring-boot-starter-test")
api project(":graphql-kickstart-spring-boot-starter-webflux")
api project(":graphql-kickstart-spring-boot-starter-tools")
api project(":graphql-kickstart-spring-boot-starter-graphql-annotations")
}
}

publishing {
publications {
mainProjectPublication(MavenPublication) {
from components.javaPlatform
}
}
}


2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ include ":voyager-spring-boot-starter"
include ":playground-spring-boot-autoconfigure"
include ":playground-spring-boot-starter"

include ':graphql-spring-boot-dependencies'

include ':graphql-kickstart-spring-boot-autoconfigure-graphql-annotations'
include ':graphql-kickstart-spring-boot-starter-graphql-annotations'
include ':graphql-kickstart-spring-boot-autoconfigure-tools'
Expand Down