Skip to content

Commit

Permalink
Convert gradle build system to Maven (#1706)
Browse files Browse the repository at this point in the history
Support Java 17
  • Loading branch information
acoburn authored Oct 2, 2023
1 parent 5fa1454 commit fab6767
Show file tree
Hide file tree
Showing 135 changed files with 4,769 additions and 2,741 deletions.
49 changes: 5 additions & 44 deletions .github/workflows/cd-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,9 @@ on:
- trellis-[0-9]+.[0-9]+.[0-9]+

jobs:
validation:
name: Gradle Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1

build:
name: Java 11 environment
runs-on: ubuntu-latest
needs: [validation]

services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: trellis
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
Expand All @@ -40,32 +21,10 @@ jobs:
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'

- name: Build with Gradle
run: ./gradlew check assemble javadoc
env:
QUARKUS_DATASOURCE_USERNAME: postgres
QUARKUS_DATASOURCE_PASSWORD: postgres
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://localhost/trellis

security:
name: Security analysis
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Run Snyk to check for vulnerabilities
env:
PROJECT_PATH: /project/trellis
SNYK_ORG: ${{ secrets.SNYK_ORG }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# Only run security scans if integration is set up
run: |
if [ "$SNYK_ORG" != "" ]; then
# don't fail the build if snyk doesn't complete successfully
docker run --name snyk -e SNYK_TOKEN -e PROJECT_PATH -v "/home/runner/work/trellis":"/project" snyk/snyk-cli:gradle-5.4 "monitor --all-sub-projects --org=$SNYK_ORG" || true
fi
- name: Build with Maven
run: ./mvnw verify javadoc:javadoc

sonatype:
name: Deploy artifacts to Sonatype
Expand All @@ -78,6 +37,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 11
cache: "maven"
- name: Publish to Sonatype
run: if [[ $(./gradlew -q getVersion) == *SNAPSHOT* ]]; then ./gradlew publish ; fi
env:
Expand All @@ -96,6 +56,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 11
cache: "maven"

- name: Publish Docker Containers
run: |
Expand Down
122 changes: 10 additions & 112 deletions .github/workflows/ci-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,12 @@ on:


jobs:
validation:
name: Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1

build:
name: Java ${{ matrix.java }} environment
needs: [validation]
runs-on: ubuntu-latest
strategy:
matrix:
java: [11]

services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: trellis
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
java: [11, 17]

steps:
- uses: actions/checkout@v3
Expand All @@ -44,111 +25,28 @@ jobs:
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Cache
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build javadoc
- name: Build with Maven
run: ./mvnw verify javadoc:javadoc
env:
QUARKUS_DATASOURCE_USERNAME: postgres
QUARKUS_DATASOURCE_PASSWORD: postgres
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://localhost/trellis

windows:
name: Windows (triplestore) environment
needs: [validation]
name: Windows environment
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
- name: Cache
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
java-version: 17
cache: 'maven'

- name: Build with Gradle
- name: Build with Maven
shell: bash
run: ./gradlew.bat check -Ptriplestore

quarkusTriplestore:
name: Quarkus (triplestore) environment
needs: [validation]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11

- name: Test the Quarkus app with a Triplestore
run: ./gradlew check -p platform/quarkus build -Ptriplestore

quarkusPostgres:
name: Quarkus (postgres) environment
needs: [validation]
runs-on: ubuntu-latest

services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: trellis
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11

- name: Test the Quarkus app with PostgreSQL
run: ./gradlew check -p platform/quarkus build
env:
QUARKUS_DATASOURCE_USERNAME: postgres
QUARKUS_DATASOURCE_PASSWORD: postgres
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://localhost/trellis

#osgi:
#name: OSGi provisioning
#needs: [validation]
#runs-on: ubuntu-latest
#steps:
#- uses: actions/checkout@v3
#- name: Set up JDK 11
#uses: actions/setup-java@v3
#with:
#distribution: 'adopt'
#java-version: 11
#- name: Cache
#uses: actions/cache@v3
#with:
#path: ~/.gradle/caches
#key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
#restore-keys: |
#${{ runner.os }}-gradle-

#- name: Build with Gradle
#run: ./gradlew -p platform/osgi check -Posgi
run: ./mvnw.cmd verify

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.gradle
build
target
*/*/docs/
.classpath
.project
Expand Down
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .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.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ docker pull trellisldp/trellis-postgresql
In most cases, you won't need to compile Trellis. Released components are available on Maven Central,
and the deployable application can be [downloaded](https://www.trellisldp.org/download.html) directly
from the Trellis website. However, if you want to build the latest snapshot, you will need, at the very least,
to have Java 11+ available. The software can be built with [Gradle](https://gradle.org) using this command:
to have Java 11+ available. The software can be built with [Maven](https://maven.apache.org/what-is-maven.html) using this command:

```bash
./gradlew install
./mvnw install
```

## Related projects
Expand Down
61 changes: 0 additions & 61 deletions auth/jwt/build.gradle

This file was deleted.

Loading

0 comments on commit fab6767

Please sign in to comment.