Skip to content

Commit

Permalink
change build tool, from Maven to Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
emmysteven committed Oct 1, 2023
1 parent 939f776 commit c96dc0e
Show file tree
Hide file tree
Showing 19 changed files with 483 additions and 850 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml → .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: '21'
distribution: 'corretto'
architecture: x64
cache: maven
cache: gradle

- name: Maven Build
run: mvn -B install -DskipTests
- name: Gradle Build
run: gradle clean build -x test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ target/

.DS_Store
.env

# Ignore Gradle build output directory
build
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

77 changes: 77 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.4' apply(false)
id 'org.graalvm.buildtools.native' version '0.9.27' apply(false)
id 'io.spring.dependency-management' version '1.1.3'
}

ext {
set('jjwtVersion', "0.11.5")
set('snakeyamlVersion', "2.2")
set('lombokVersion', "1.18.30")
set('springBootVersion', "3.1.4")
set('springCloudVersion', "2022.0.4")
set('mapstructVersion', "1.5.5.Final")
}

allprojects {
group = 'meetona'
version = '0.0.1'

repositories {
mavenLocal()
mavenCentral()
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

java {
sourceCompatibility = '21'
targetCompatibility = '21'
}

// apply from: '$rootProject.projectDir/dependencies.gradle'

configurations {
compileOnly.extendsFrom annotationProcessor
testCompileOnly.extendsFrom annotationProcessor
testAnnotationProcessor.extendsFrom annotationProcessor
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation "org.yaml:snakeyaml:${snakeyamlVersion}"
implementation 'de.siegmar:logback-gelf:4.0.2'

compileOnly "org.projectlombok:lombok:${lombokVersion}"
developmentOnly 'org.springframework.boot:spring-boot-devtools'

annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:postgresql:1.19.0'
testImplementation 'org.springframework.amqp:spring-rabbit-test'
testImplementation 'org.springframework.security:spring-security-test:6.0.2'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

}

7 changes: 7 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jar.enabled = true

bootJar.enabled = false

dependencies {
implementation project(':')
}
15 changes: 0 additions & 15 deletions core/pom.xml

This file was deleted.

18 changes: 18 additions & 0 deletions data/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
jar.enabled = true

bootJar.enabled = false

dependencies {
implementation project(':core')
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-amqp'
implementation 'org.springframework.boot:spring-boot-starter-freemarker'

implementation "org.mapstruct:mapstruct:${mapstructVersion}"
implementation "io.jsonwebtoken:jjwt-api:${jjwtVersion}"

runtimeOnly 'org.postgresql:postgresql'
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"
}
64 changes: 0 additions & 64 deletions data/pom.xml

This file was deleted.

Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c96dc0e

Please sign in to comment.