Configure compiler conventions in modules

This commit applies the Compiler Conventions Gradle plugin to the
project modules and fix the issues raised by the compiler linter.

This commit also moves version management to the main build file for a
few dependencies, aligning the versions in the process.
This commit is contained in:
Brian Clozel
2021-09-16 19:53:19 +02:00
parent 5c5554b6b1
commit 762f59b2f3
12 changed files with 51 additions and 22 deletions

View File

@@ -28,6 +28,7 @@ subprojects {
configure(moduleProjects) {
apply plugin: 'java-library'
apply plugin: 'org.springframework.graphql.compiler'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -41,17 +42,33 @@ configure(moduleProjects) {
mavenBom "org.springframework:spring-framework-bom:5.3.9"
mavenBom "org.springframework.data:spring-data-bom:2021.0.4"
mavenBom "org.springframework.security:spring-security-bom:5.5.2"
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.2"
mavenBom "org.junit:junit-bom:5.7.2"
}
dependencies {
dependency "com.graphql-java:graphql-java:${graphQlJavaVersion}"
dependency 'org.assertj:assertj-core:3.20.2'
dependency "javax.annotation:javax.annotation-api:1.3.2"
dependency "javax.servlet:javax.servlet-api:4.0.1"
dependency "com.google.code.findbugs:jsr305:3.0.2"
dependency "org.assertj:assertj-core:3.20.2"
dependency "com.jayway.jsonpath:json-path:2.5.0"
dependency "org.skyscreamer:jsonassert:1.5.0"
dependencySet(group: 'com.querydsl', version: '4.4.0') {
entry 'querydsl-apt'
entry 'querydsl-collections'
entry 'querydsl-core'
}
dependencySet(group: 'org.apache.logging.log4j', version: '2.14.1') {
entry 'log4j-api'
entry 'log4j-core'
entry 'log4j-jul'
entry 'log4j-slf4j-impl'
}
dependencySet(group: 'org.mockito', version: '3.11.2') {
entry 'mockito-core'
entry 'mockito-inline'
entry 'mockito-junit-jupiter'
}
}
generatedPomCustomization {
enabled = false

View File

@@ -3,6 +3,7 @@ import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
id 'org.springframework.boot' version "${bootVersion}" apply false
id 'java-library'
id 'org.springframework.graphql.compiler'
}
group = 'org.springframework.experimental'
@@ -41,13 +42,14 @@ dependencies {
compileOnly 'org.springframework.security:spring-security-config'
compileOnly 'org.springframework.security:spring-security-web'
compileOnly 'com.querydsl:querydsl-core:4.4.0'
compileOnly 'com.querydsl:querydsl-core'
compileOnly 'org.springframework.data:spring-data-commons'
compileOnly project(':spring-graphql-test')
compileOnly 'org.junit.jupiter:junit-jupiter-api'
compileOnly 'org.springframework.boot:spring-boot-test'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'com.google.code.findbugs:jsr305'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor'

View File

@@ -30,6 +30,7 @@ import org.springframework.core.io.support.ResourcePatternResolver;
* @author Brian Clozel
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class InvalidSchemaLocationsException extends NestedRuntimeException {
private final List<SchemaLocation> schemaLocations;

View File

@@ -13,19 +13,17 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'com.querydsl:querydsl-core'
implementation 'com.querydsl:querydsl-jpa'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
testImplementation project(':spring-graphql-test')
testImplementation 'org.springframework:spring-webflux'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation(
"com.querydsl:querydsl-core:4.4.0",
"com.querydsl:querydsl-jpa:4.4.0"
)
annotationProcessor "com.querydsl:querydsl-apt:4.4.0:jpa",
"org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final",
"javax.annotation:javax.annotation-api:1.3.2"
annotationProcessor 'com.querydsl:querydsl-apt:4.4.0:jpa',
'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final',
'javax.annotation:javax.annotation-api'
}
compileJava {

View File

@@ -6,19 +6,21 @@ dependencies {
api 'io.projectreactor:reactor-core'
api 'org.springframework:spring-context'
api 'org.springframework:spring-test'
api 'com.jayway.jsonpath:json-path:2.5.0'
api 'com.jayway.jsonpath:json-path'
compileOnly "javax.annotation:javax.annotation-api:1.3.2"
compileOnly 'javax.annotation:javax.annotation-api'
compileOnly 'org.springframework:spring-webflux'
compileOnly 'org.springframework:spring-webmvc'
compileOnly 'org.springframework:spring-websocket'
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly 'org.skyscreamer:jsonassert:1.5.0'
compileOnly 'javax.servlet:javax.servlet-api'
compileOnly 'org.skyscreamer:jsonassert'
compileOnly 'com.google.code.findbugs:jsr305'
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core:3.8.0'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.skyscreamer:jsonassert'
testImplementation 'org.springframework:spring-webflux'
testImplementation 'org.springframework:spring-test'
testImplementation 'io.projectreactor:reactor-test'

View File

@@ -34,6 +34,7 @@ import org.springframework.lang.Nullable;
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings("serial")
class TestGraphQlError implements GraphQLError {
@Nullable

View File

@@ -5,28 +5,31 @@ dependencies {
api 'io.projectreactor:reactor-core'
api 'org.springframework:spring-context'
compileOnly "javax.annotation:javax.annotation-api:1.3.2"
compileOnly 'javax.annotation:javax.annotation-api'
compileOnly 'org.springframework:spring-webflux'
compileOnly 'org.springframework:spring-webmvc'
compileOnly 'org.springframework:spring-websocket'
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly 'javax.servlet:javax.servlet-api'
compileOnly 'org.springframework.security:spring-security-core'
compileOnly 'com.querydsl:querydsl-core:4.4.0'
compileOnly 'com.querydsl:querydsl-core'
compileOnly 'org.springframework.data:spring-data-commons'
compileOnly 'com.google.code.findbugs:jsr305'
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core:3.11.1'
testImplementation 'org.mockito:mockito-core'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework:spring-webflux'
testImplementation 'org.springframework:spring-webmvc'
testImplementation 'org.springframework:spring-websocket'
testImplementation 'org.springframework:spring-test'
testImplementation 'org.springframework.data:spring-data-commons'
testImplementation 'com.querydsl:querydsl-core:4.4.0'
testImplementation 'javax.servlet:javax.servlet-api:4.0.1'
testImplementation 'com.querydsl:querydsl-core'
testImplementation 'javax.servlet:javax.servlet-api'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'

View File

@@ -25,6 +25,7 @@ import org.springframework.core.NestedRuntimeException;
* @author Rossen Stoyanchev
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class MissingArgumentException extends NestedRuntimeException {
private final String argumentName;

View File

@@ -57,6 +57,7 @@ class ExceptionResolversExceptionHandler implements DataFetcherExceptionHandler
}
@Override
@Deprecated
public DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters parameters) {
Throwable exception = parameters.getException();
exception = ((exception instanceof CompletionException) ? exception.getCause() : exception);

View File

@@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException;
* @author Brian Clozel
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class MissingSchemaException extends NestedRuntimeException {
public MissingSchemaException() {

View File

@@ -314,6 +314,7 @@ public class GraphQlWebSocketHandler implements WebSocketHandler {
}
@SuppressWarnings("serial")
private static class SubscriptionExistsException extends RuntimeException {
}

View File

@@ -466,6 +466,7 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub
}
@SuppressWarnings("serial")
private static class SubscriptionExistsException extends RuntimeException {
}