Skip to content

Commit

Permalink
convert graphql-webflux from gradle to maven (#975)
Browse files Browse the repository at this point in the history
* convert from gradle to maven

* remove lombok usage
  • Loading branch information
rajadilipkolli authored Nov 14, 2023
1 parent bf352ba commit 538edda
Show file tree
Hide file tree
Showing 32 changed files with 990 additions and 953 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
- boot-jobrunr-sample/pom.xml
- boot-mongodb-elasticsearch/pom.xml
- boot-opensearch-sample/pom.xml
- graphql/boot-graphql-webflux/build.gradle.kts
- graphql/boot-graphql-webflux/pom.xml
- graphql/boot-graphql-querydsl/pom.xml
- graphql/boot-graphql-webmvc/pom.xml
- boot-strategy-plugin/build.gradle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 17
distribution: "zulu"
cache: "gradle"
java-version: 21
distribution: "microsoft"
cache: "maven"

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Build and analyze
run: ./gradlew clean build --info
run: ./mvnw clean verify
39 changes: 0 additions & 39 deletions graphql/boot-graphql-webflux/.github/workflows/gradle-dev.yml

This file was deleted.

40 changes: 0 additions & 40 deletions graphql/boot-graphql-webflux/.github/workflows/gradle-main.yml

This file was deleted.

43 changes: 43 additions & 0 deletions graphql/boot-graphql-webflux/.github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI Build

on:
push:
branches:
- "**"

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '17' ]
steps:
- uses: actions/checkout@v3

- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'maven'

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Build with Maven
run: ./mvnw clean verify

- if: ${{ github.ref == 'refs/heads/main' }}
name: SonarQube Scan
run: ./mvnw compile sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ github.ref == 'refs/heads/main' }}
name: Build and Publish Docker Image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=${{ secrets.DOCKER_USERNAME }}/boot-graphql-querydsl
docker push ${{ secrets.DOCKER_USERNAME }}/boot-graphql-querydsl
18 changes: 7 additions & 11 deletions graphql/boot-graphql-webflux/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
Expand All @@ -13,25 +12,22 @@ build/
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Expand Down
Binary file not shown.
18 changes: 18 additions & 0 deletions graphql/boot-graphql-webflux/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion graphql/boot-graphql-webflux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM eclipse-temurin:17.0.9_9-jre-focal as builder
WORKDIR application
ARG JAR_FILE=build/libs/boot-graphql-webflux-0.0.1-SNAPSHOT.jar
ARG JAR_FILE=target/boot-graphql-webflux-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

Expand Down
20 changes: 18 additions & 2 deletions graphql/boot-graphql-webflux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,31 @@

The spring-boot-starter-graphql is a starter dependency for Spring Boot applications that allows them to integrate with GraphQL APIs. It provides a set of tools and libraries that enable developers to easily build GraphQL-based applications and expose them through a GraphQL endpoint. The starter includes support for GraphQL queries, mutations, subscriptions, and schema definitions, as well as integration with Spring Boot's autoconfiguration and dependency injection features.

### Format code

```shell
$ ./mvnw spotless:apply
```

### Run tests

```shell
./gradlew clean build
$ ./mvnw clean verify
```

### Run locally

```shell
$ docker-compose -f docker/docker-compose.yml up -d
$ ./mvnw spring-boot:run -Dspring-boot.run.profiles=local
```

### Using Testcontainers at Development Time
You can run `TestApplication.java` from your IDE directly.
You can also run the application using Maven as follows:

```shell
./gradlew bootRun -Plocal
./mvnw spring-boot:test-run
```

### Useful Links
Expand Down
Loading

0 comments on commit 538edda

Please sign in to comment.