Skip to content

Commit

Permalink
fix: build errors after library updates
Browse files Browse the repository at this point in the history
  • Loading branch information
oliemansm committed Dec 6, 2022
1 parent fdc6e9e commit 0ef678f
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Cache Gradle
uses: actions/cache@v3
env:
java-version: 11
java-version: 17
with:
path: |
~/.gradle/caches
Expand All @@ -48,11 +48,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
java: [ 11, 17 ]
java: [ 17, 19 ]
needs: validation
runs-on: ${{ matrix.os }}
steps:
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "jacoco"
}

sonarqube {
sonar {
properties {
property "sonar.projectKey", "graphql-java-kickstart_graphql-java-kickstart-samples"
property "sonar.organization", "graphql-java-kickstart"
Expand All @@ -27,8 +27,8 @@ subprojects {
}

compileJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

test {
Expand All @@ -37,7 +37,7 @@ subprojects {

jacocoTestReport {
reports {
xml.enabled = true
xml.required = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package graphql.kickstart.sample;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
@EnableWebSecurity
class SecurityConfig extends WebSecurityConfigurerAdapter {
class SecurityConfig {

@Override
protected void configure(final HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll();
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests().anyRequest().permitAll();
return http.build();
}
}
2 changes: 1 addition & 1 deletion file-upload/src/main/java/upload/UploadMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import graphql.kickstart.tools.GraphQLMutationResolver;
import java.io.IOException;
import javax.servlet.http.Part;
import jakarta.servlet.http.Part;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

Expand Down
6 changes: 2 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
LIB_GRAPHQL_SERVLET_VER=14.0.0
LIB_GRAPHQL_SERVLET_VER=15.0.0
LIB_GRAPHQL_SPRING_BOOT_VER=15.0.0
LIB_GRAPHQL_TOOLS_VER=13.0.2
LIB_GRAPHQL_EXTENDED_VALIDATION_VER=19.1
LIB_SPRING_BOOT_VER=2.7.6
sourceCompatibility=11
targetCompatibility=11
LIB_SPRING_BOOT_VER=3.0.0
2 changes: 1 addition & 1 deletion graphql-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies {

implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation "io.reactivex.rxjava2:rxjava"
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
runtimeOnly("com.h2database:h2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import graphql.annotations.annotationTypes.GraphQLNonNull;
import graphql.kickstart.spring.boot.graphql.annotations.example.model.directives.UpperCaseDirective;
import java.time.LocalDate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class CreatePersonTest {
class CreatePersonTest {

private static final String FIRST_NAME = "John";
private static final String LAST_NAME = "Doe";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import graphql.kickstart.servlet.context.GraphQLServletContextBuilder;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.Session;
import javax.websocket.server.HandshakeRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.websocket.Session;
import jakarta.websocket.server.HandshakeRequest;
import org.dataloader.DataLoader;
import org.dataloader.DataLoaderFactory;
import org.dataloader.DataLoaderRegistry;
Expand Down
7 changes: 2 additions & 5 deletions servlet-hello-world/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def jettyVersion = '9.4.49.v20220914'
def jettyVersion = '11.0.12'

dependencies {
implementation "com.graphql-java-kickstart:graphql-java-servlet:$LIB_GRAPHQL_SERVLET_VER"
Expand All @@ -7,8 +7,5 @@ dependencies {
implementation 'org.slf4j:slf4j-simple:2.0.5'
implementation "org.eclipse.jetty:jetty-webapp:${jettyVersion}"
implementation "org.eclipse.jetty:jetty-annotations:${jettyVersion}"
implementation "org.eclipse.jetty.websocket:websocket-api:${jettyVersion}"
implementation "org.eclipse.jetty.websocket:websocket-server:${jettyVersion}"
implementation "org.eclipse.jetty.websocket:javax-websocket-server-impl:${jettyVersion}"
implementation "org.eclipse.jetty.websocket:websocket-common:${jettyVersion}"
implementation "org.eclipse.jetty.websocket:websocket-jetty-server:${jettyVersion}"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package hello;

import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;
import jakarta.websocket.HandshakeResponse;
import jakarta.websocket.server.HandshakeRequest;
import jakarta.websocket.server.ServerEndpointConfig;

public class GraphQLWSEndpointConfigurer extends ServerEndpointConfig.Configurator {

Expand Down
10 changes: 3 additions & 7 deletions servlet-hello-world/src/main/java/hello/HttpMain.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package hello;

import javax.websocket.server.ServerEndpointConfig;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer;
import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;

class HttpMain {

Expand All @@ -21,13 +20,10 @@ public static void main(String[] args) throws Exception {
context.addServlet(HelloServlet.class, "/graphql");
server.setHandler(context);

WebSocketServerContainerInitializer.configure(
JettyWebSocketServletContainerInitializer.configure(
context,
(servletContext, serverContainer) ->
serverContainer.addEndpoint(
ServerEndpointConfig.Builder.create(SubscriptionEndpoint.class, "/subscriptions")
.configurator(new GraphQLWSEndpointConfigurer())
.build()));
serverContainer.addMapping("/subscriptions", GraphQLWSEndpointConfigurer.class));

server.setHandler(context);

Expand Down
2 changes: 1 addition & 1 deletion spring-boot-commons.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Common settings only needed for Spring Boot based samples

apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.boot"
//apply plugin: "org.springframework.boot"

dependencyManagement {
imports {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.Part;
import jakarta.servlet.http.Part;

@GraphQLSchema
public class TodoSchema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import graphql.kickstart.tools.GraphQLSubscriptionResolver;
import graphql.schema.DataFetchingEnvironment;
import java.util.Optional;
import javax.websocket.Session;
import jakarta.websocket.Session;
import org.reactivestreams.Publisher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package subscription;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
class SecurityConfiguration extends WebSecurityConfigurerAdapter {
class SecurityConfiguration {

@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests()
.anyRequest()
.permitAll()
.and()
Expand All @@ -19,5 +20,6 @@ protected void configure(HttpSecurity http) throws Exception {
.and()
.logout()
.permitAll();
return http.build();
}
}
2 changes: 1 addition & 1 deletion subscription/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencyManagement {
dependencies {
implementation("com.graphql-java-kickstart:graphql-spring-boot-starter")

implementation "io.reactivex.rxjava2:rxjava"
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "io.projectreactor:reactor-core"
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-websocket")
Expand Down

0 comments on commit 0ef678f

Please sign in to comment.