diff --git a/.github/workflows/cd-config.yml b/.github/workflows/cd-config.yml index d6c67a7dd..e0a9472d0 100644 --- a/.github/workflows/cd-config.yml +++ b/.github/workflows/cd-config.yml @@ -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 @@ -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 @@ -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: @@ -96,6 +56,7 @@ jobs: with: distribution: 'adopt' java-version: 11 + cache: "maven" - name: Publish Docker Containers run: | diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 4d35d3d9c..120f9af43 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index 31e4883aa..82e4d0910 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -.gradle -build +target */*/docs/ .classpath .project diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..cb28b0e37 Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..ac184013f --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -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 diff --git a/README.md b/README.md index 93cc12059..30f397333 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/auth/jwt/build.gradle b/auth/jwt/build.gradle deleted file mode 100644 index ed6a00275..000000000 --- a/auth/jwt/build.gradle +++ /dev/null @@ -1,61 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis MicroProfile JWT-Auth' - -ext { - moduleName = 'org.trellisldp.jwt' -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - api "org.eclipse.microprofile.jwt:microprofile-jwt-auth-api" - - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation project(":trellis-common") - - testImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") - - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "io.smallrye:smallrye-jwt:$smallryeJwtVersion" - testImplementation "jakarta.json.bind:jakarta.json.bind-api:$jsonbApiVersion" - testImplementation "org.eclipse:yasson:$yassonVersion" - testImplementation "org.glassfish.jersey.core:jersey-server" - testImplementation("org.jboss.weld:weld-junit5:$weldVersion") { - exclude group: "org.jboss.spec.javax.interceptor", module: "jboss-interceptors-api_1.2_spec" - exclude group: "org.jboss.spec.javax.el", module: "jboss-el-api_3.0_spec" - } - testImplementation "jakarta.el:jakarta.el-api:$elVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - -test { - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "$moduleName/$moduleName=weld.junit5", - '--add-opens', "$moduleName/$moduleName=weld.core.impl", - '--add-opens', 'java.base/java.lang=weld.core.impl', - ] - } -} diff --git a/auth/jwt/pom.xml b/auth/jwt/pom.xml new file mode 100644 index 000000000..2ab3297e7 --- /dev/null +++ b/auth/jwt/pom.xml @@ -0,0 +1,143 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + + org.trellisldp + trellis-jwt + 0.20.0-SNAPSHOT + Trellis MicroProfile JWT-Auth + https://www.trellisldp.org + + Trellis LDP MicroProfile JWT module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.inject + jakarta.inject-api + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.eclipse.microprofile.jwt + microprofile-jwt-auth-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.slf4j + slf4j-api + + + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.smallrye.config + smallrye-config + test + + + io.smallrye + smallrye-jwt + test + + + jakarta.json.bind + jakarta.json.bind-api + test + + + jakarta.json + jakarta.json-api + test + + + org.eclipse + yasson + test + + + org.glassfish.jersey.core + jersey-server + test + + + jakarta.el + jakarta.el-api + test + + + org.jboss.weld + weld-junit5 + test + + + org.slf4j + slf4j-simple + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.lang=ALL-UNNAMED + + + + + + diff --git a/auth/jwt/src/test/resources/logback.xml b/auth/jwt/src/test/resources/logback.xml deleted file mode 100644 index aa2e08364..000000000 --- a/auth/jwt/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/auth/pom.xml b/auth/pom.xml new file mode 100644 index 000000000..50998c29a --- /dev/null +++ b/auth/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../parent + + + org.trellisldp + trellis-auth-parent + 0.20.0-SNAPSHOT + Trellis Auth parent + https://www.trellisldp.org + + + Trellis LDP server: auth components + + pom + + + jwt + webac + + diff --git a/auth/webac/build.gradle b/auth/webac/build.gradle deleted file mode 100644 index 978297016..000000000 --- a/auth/webac/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis WebAC' - -ext { - moduleName = 'org.trellisldp.webac' - testModules = ['org.apache.jena.commonsrdf', 'smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:${cdiApiVersion}" - api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api "org.eclipse.microprofile.metrics:microprofile-metrics-api" - api project(':trellis-api') - api project(':trellis-common') - - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.glassfish.jersey.core:jersey-server" - testImplementation "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation project(':trellis-triplestore') -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} diff --git a/auth/webac/pom.xml b/auth/webac/pom.xml new file mode 100644 index 000000000..5f4ba42b8 --- /dev/null +++ b/auth/webac/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-webac + 0.20.0-SNAPSHOT + Trellis WebAC + https://www.trellisldp.org + + Trellis LDP WebAC module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.inject + jakarta.inject-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.slf4j + slf4j-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-arq + + + org.apache.jena + jena-commonsrdf + + + + + org.trellisldp + trellis-triplestore + ${project.version} + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.smallrye.config + smallrye-config + test + + + org.glassfish.jersey.core + jersey-server + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/auth/webac/src/main/java/module-info.java b/auth/webac/src/main/java/module-info.java index 62fcb8852..f20350f42 100644 --- a/auth/webac/src/main/java/module-info.java +++ b/auth/webac/src/main/java/module-info.java @@ -21,6 +21,9 @@ requires org.trellisldp.vocabulary; requires org.apache.commons.rdf.api; + requires org.apache.jena.core; + requires org.apache.jena.arq; + requires org.apache.jena.commonsrdf; requires org.slf4j; requires jakarta.enterprise.cdi.api; @@ -29,6 +32,7 @@ requires java.xml.bind; requires java.ws.rs; requires microprofile.config.api; + requires microprofile.metrics.api; uses org.trellisldp.api.ResourceService; uses org.trellisldp.api.IOService; diff --git a/auth/webac/src/test/resources/logback-test.xml b/auth/webac/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/auth/webac/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/auth/webac/src/test/resources/simplelogger.properties b/auth/webac/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/auth/webac/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 40401632a..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Gradle -# Build your Java project and run tests with Gradle using a Gradle wrapper script. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/java - -trigger: -- main - -pool: - vmImage: 'ubuntu-latest' - -steps: -- task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - jdkArchitectureOption: 'x64' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'build -Ptriplestore' diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 2c7e7ffd2..000000000 --- a/build.gradle +++ /dev/null @@ -1,544 +0,0 @@ -plugins { - id 'com.github.ben-manes.versions' version "0.42.0" - id 'com.github.hierynomus.license' version "0.15.0" - id 'net.researchgate.release' version "2.8.1" - id 'org.gradle.test-retry' version "1.4.0" - id 'org.owasp.dependencycheck' version "7.1.1" - id 'org.sonarqube' version "3.5.0.2730" -} - -ext { - // Core dependencies - commonsCodecVersion = "1.15" - commonsIoVersion = "2.11.0" - commonsLangVersion = "3.12.0" - commonsRdfVersion = "0.5.0" - slf4jVersion = "1.7.36" - - // JakartaEE - activationApiVersion = "1.2.2" - annotationApiVersion = "1.3.5" - cdiApiVersion = "2.0.2" - elVersion = "3.0.3" - injectApiVersion = "1.0.1" - jaxbApiVersion = "2.3.3" - jaxrsApiVersion = "2.1.6" - jsonApiVersion = "1.1.6" - jsonbApiVersion = "1.0.2" - managementApiVersion = "1.1.4" - validationApiVersion = "2.0.2" - - // MicroProfile - microprofileVersion = "4.1" - microprofileReactiveMessagingVersion = "2.0.1" - - // Component dependencies - guavaVersion = "31.1-jre" - jacksonVersion = "2.14.0" - jdbiVersion = "3.35.0" - jenaVersion = "4.6.1" - jsonldVersion = "0.13.4" - liquibaseVersion = "4.10.0" - mustacheVersion = "0.9.10" - quarkusVersion = "2.13.0.Final" - rxjavaVersion = "2.2.21" - snakeyamlVersion = "1.33" - - // Databases - h2Version = "1.4.200" - mariadbVersion = "2.7.1" - postgresVersion = "42.4.0" - - // Testing - awaitilityVersion = "4.2.0" - bouncycastleVersion = "1.68" - commonsTextVersion = "1.10.0" - cxfVersion = "3.5.4" - glassfishJaxbVersion = "2.3.3" - jerseyVersion = "2.32" - junitVersion = "5.9.1" - hamcrestVersion = "2.2" - logbackVersion = "1.2.11" - mockitoVersion = "4.6.1" - qpidVersion = "8.0.4" - sleepycatVersion = "18.3.12" - smallryeConfigVersion = "2.10.0" - smallryeHealthVersion = "3.2.1" - smallryeJwtVersion = "3.5.1" - smallryeReactiveVersion = "1.0.8" - smallryeReactiveOperatorsVersion = "1.0.13" - testcontainersVersion = "1.17.3" - weldVersion = "2.0.2.Final" - yassonVersion = "1.0.8" - - // Containers - postgresContainerVersion = "10.8" - - // Tooling - jacocoToolVersion = "0.8.6" - checkstyleToolVersion = "8.34" - pitestToolVersion = "1.5.2" - pitestJunitPluginVersion = "0.12" - pmdToolVersion = "6.24.0" - - omitFromJacocoReporting = [ - 'trellis-bom', - 'trellis-openliberty', - 'trellis-quarkus', - 'trellis-test' - ] - - omitFromMavenPublishing = [ - 'trellis-quarkus', - 'trellis-openliberty' - ] -} - -allprojects { subproj -> - - apply plugin: 'checkstyle' - apply plugin: 'com.github.hierynomus.license' - apply plugin: 'jacoco' - apply plugin: 'java' - apply plugin: 'maven-publish' - apply plugin: 'org.gradle.test-retry' - apply plugin: 'org.owasp.dependencycheck' - apply plugin: 'pmd' - apply plugin: 'signing' - - ext { - vendor = 'Trellis LDP' - homepage = 'https://www.trellisldp.org/' - docURL = 'https://www.trellisldp.org/docs/trellis/current/apidocs/' - license = 'Apache-2.0' - - } - - jacoco.toolVersion = jacocoToolVersion - - group = 'org.trellisldp' - - repositories { - mavenCentral() - jcenter() - } - - dependencies { - testImplementation platform("org.junit:junit-bom:$junitVersion") - - testImplementation "org.junit.jupiter:junit-jupiter-api" - testImplementation "org.junit.jupiter:junit-jupiter-params" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" - testRuntimeOnly "org.junit.platform:junit-platform-launcher" - } - - dependencyCheck { - analyzers { - assemblyEnabled = false - retirejs { - enabled = false - } - } - } - - gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - } - } - - release { - tagTemplate = '$name-$version' - git { - /* Note: for maintenance branches, change this to the appropriate branch name. */ - requireBranch = 'main' - signTag = true - } - } - - configurations.all { - exclude group: 'commons-logging', module: 'commons-logging' - exclude group: 'com.google.code.findbugs', module: 'jsr305' - // Titanium requires JakartaEE 9+ - exclude group: 'com.apicatalog', module: 'titanium-json-ld' - - resolutionStrategy { - // Use the JakartaEE 8 version of json-p - force "org.glassfish:jakarta.json:$jsonApiVersion" - } - - resolutionStrategy.dependencySubstitution { - substitute module("org.apache.geronimo.specs:geronimo-annotation_1.2_spec") with module ("jakarta.annotation:jakarta.annotation-api:$annotationApiVersion") - substitute module("org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec") with module("jakarta.management.j2ee:jakarta.management.j2ee-api:$managementApiVersion") - substitute module("org.glassfish.hk2.external:jakarta.inject") with module("jakarta.inject:jakarta.inject-api:$injectApiVersion") - substitute module("javax.enterprise:cdi-api") with module("jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion") - substitute module("javax.annotation:javax.annotation-api") with module("jakarta.annotation:jakarta.annotation-api:$annotationApiVersion") - substitute module("javax.inject:javax.inject") with module("jakarta.inject:jakarta.inject-api:$injectApiVersion") - } - } -} - -subprojects { subproj -> - - sourceCompatibility = 11 - targetCompatibility = 11 - - plugins.withType(JavaPlugin).configureEach { - java { - modularity.inferModulePath = true - } - } - - afterEvaluate { - if (subproj.ext.has('moduleName')) { - def moduleName = subproj.ext.get('moduleName') - - compileJava { - inputs.property("moduleName", moduleName) - doFirst { - options.compilerArgs = [ - '--module-path', classpath.asPath, - ] - classpath = files() - } - } - compileTestJava { - inputs.property("moduleName", moduleName) - def mods = subproj.ext.has("testModules") ? subproj.ext.get("testModules") : [] - mods.add('org.junit.jupiter.api') - mods.add('org.junit.jupiter.params') - doFirst { - options.compilerArgs = [ - '--module-path', classpath.asPath, - '--add-modules', mods.join(','), - '--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath, - ] - mods.forEach { mod -> options.compilerArgs += [ '--add-reads', "$moduleName=$mod"] } - classpath = files() - } - } - test { - inputs.property("moduleName", moduleName) - def mods = subproj.ext.has("testModules") ? subproj.ext.get("testModules") : [] - mods.add('org.junit.jupiter.api') - mods.add('org.junit.jupiter.params') - doFirst { - jvmArgs = [ - '--module-path', classpath.asPath, - '--add-modules', 'ALL-MODULE-PATH', - '--add-opens', "$moduleName/$moduleName=org.junit.platform.commons", - '--add-opens', "$moduleName/$moduleName=org.mockito", - '--patch-module', "$moduleName=" + files(sourceSets.main.output.resourcesDir, sourceSets.test.output).asPath, - ] - mods.forEach { mod -> jvmArgs += [ '--add-reads', "$moduleName=$mod"] } - classpath = files() - } - } - - javadoc { - failOnError = false - inputs.property("moduleName", moduleName) - doFirst { - options.setModulePath(classpath.collect { f -> file(f) }) - } - } - } - } - - jar { - from("$rootDir/LICENSE") { - into "META-INF" - } - } - - test { - useJUnitPlatform() - testLogging { - exceptionFormat "full" - showStackTraces false - } - retry { - maxRetries = (project.findProperty("trellis.test.retry") ?: "3").toInteger() - maxFailures = 20 - } - } - - pmd { - ignoreFailures = true - consoleOutput = true - incrementalAnalysis = true - toolVersion = pmdToolVersion - sourceSets = [sourceSets.main] - rulePriority = 4 - ruleSets = [] - ruleSetConfig = resources.text.fromFile(rootProject.file('buildtools/src/main/resources/pmd/pmd.xml')) - } - - // Enable PMD analysis on request (e.g. ./gradlew build -P pmdAnalysis) - pmdMain.enabled = project.hasProperty("pmdAnalysis") - - checkstyle { - configFile = rootProject.file('buildtools/src/main/resources/checkstyle/checkstyle.xml') - configProperties.checkstyleConfigDir = rootProject.file('buildtools/src/main/resources/checkstyle/') - toolVersion = checkstyleToolVersion - } - - task javadocJar(type: Jar) { - classifier 'javadoc' - from("$rootDir/LICENSE") { - into "META-INF" - } - from javadoc - } - - task sourceJar(type: Jar) { - classifier 'sources' - from("$rootDir/LICENSE") { - into "META-INF" - } - from sourceSets.main.allSource - } - - artifacts { - archives javadocJar - archives sourceJar - } - - license { - include "**/*.java" - header rootProject.file('buildtools/src/main/resources/license/HEADER.txt') - strictCheck true - mapping { - java = 'SLASHSTAR_STYLE' - } - } - - downloadLicenses { - includeProjectDependencies = true - dependencyConfiguration = 'compileClasspath' - } - - publishing { - publications { - maven(MavenPublication) { - pom { - packaging = 'jar' - url = 'https://www.trellisldp.org' - inceptionYear = '2017' - name = 'Trellis Linked Data Server' - description = 'The core components for a Trellis linked data server' - - organization { - name = project.vendor - url = project.homepage - } - - developers { - developer { - id = 'acoburn' - name = 'Aaron Coburn' - email = 'acoburn (at) apache (dot) org' - } - } - - scm { - url = 'https://github.com/trellis-ldp/trellis' - connection = 'scm:git:https://github.com/trellis-ldp/trellis.git' - developerConnection = 'scm:git:git@github.com:trellis-ldp/trellis.git' - tag = 'HEAD' - } - - licenses { - license { - name = 'Apache-2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' - comments = 'Copyright (c) 2017 - 2020 Aaron Coburn and individual contributors' - distribution = 'repo' - } - } - - } - pom.withXml { - // eliminate test-scoped dependencies - asNode().dependencies.removeAll { dep -> dep.scope == "test" } - // use provided scope for JavaEE dependencies - asNode().dependencies.each { - deps -> deps.findAll { dep -> dep.groupId[0].text().startsWith("jakarta.") } - .each { dep -> dep.scope[0].value = "provided" } } - } - - from components.java - - artifact(sourceJar) { - classifier = 'sources' - } - - artifact(javadocJar) { - classifier = 'javadoc' - } - } - } - repositories { - maven { - def sonatypeUsername = project.hasProperty('ossrhUsername') ? ossrhUsername : System.getenv("SONATYPE_USERNAME") ?: "" - def sonatypePassword = project.hasProperty('ossrhPassword') ? ossrhPassword : System.getenv("SONATYPE_PASSWORD") ?: "" - if (version.endsWith("SNAPSHOT")) { - url "https://oss.sonatype.org/content/repositories/snapshots/" - } else { - url "https://oss.sonatype.org/service/local/staging/deploy/maven2" - } - credentials { - username sonatypeUsername - password sonatypePassword - } - } - } - } - - tasks.withType(PublishToMavenRepository) { - onlyIf { - ! omitFromMavenPublishing.contains(subproj.name) - } - } - tasks.withType(PublishToMavenLocal) { - onlyIf { - ! omitFromMavenPublishing.contains(subproj.name) - } - } - task install(dependsOn: [assemble, publishToMavenLocal]) - task upload(dependsOn: [assemble, publish]) - - signing { - required { !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("publish") } - sign publishing.publications - } - - tasks.withType(Sign) { - onlyIf { !version.endsWith("SNAPSHOT") } - } - - processResources { - outputs.upToDateWhen { false } - filesMatching(['**/features.xml', '**/banner.txt']) { - expand project.properties - } - } - - javadoc { - failOnError = false - options.addBooleanOption('html5', true) - options { - tags = ["apiNote:a:API Note:", - "implSpec:a:Implementation Requirements:", - "implNote:a:Implementation Note:"] - links "https://docs.oracle.com/en/java/javase/11/docs/api/" - links 'https://jakarta.ee/specifications/platform/8/apidocs/' - links 'https://commons.apache.org/proper/commons-rdf/apidocs/' - links 'https://commons.apache.org/proper/commons-codec/apidocs/' - links 'https://jena.apache.org/documentation/javadoc/rdfconnection/' - } - } - - sonarqube { - skipProject = ! JavaVersion.current().isJava11() - } - - afterReleaseBuild.dependsOn publish - afterReleaseBuild.dependsOn assemble - - afterEvaluate { - if (! omitFromJacocoReporting.contains(subproj.name)) { - jacoco { - applyTo subproj.tasks.matching { it.name == 'junitPlatformTest' } - } - } - } -} - -configure(rootProject) { - - task apidocs(type: Javadoc) { - failOnError false - outputs.upToDateWhen { false } - destinationDir = new File(projectDir, "docs/apidocs/${project.version}") - title = "Trellis Linked Data Server Documentation" - exclude '**/impl/*' - exclude '**/*Tests.java' - exclude '**/module-info.java' - options { - tags = ["apiNote:a:API Note:", - "implSpec:a:Implementation Requirements:", - "implNote:a:Implementation Note:"] - memberLevel = JavadocMemberLevel.PUBLIC - links "https://docs.oracle.com/en/java/javase/11/docs/api/" - links 'https://jakarta.ee/specifications/platform/8/apidocs/' - links 'https://commons.apache.org/proper/commons-rdf/apidocs/' - links 'https://commons.apache.org/proper/commons-codec/apidocs/' - links 'https://jena.apache.org/documentation/javadoc/rdfconnection/' - } - - source subprojects.collect { project -> project.sourceSets.main.allJava } - classpath = files(subprojects.collect { project -> project.sourceSets.main.compileClasspath }) - - options.addBooleanOption('html5', true) - } - - sonarqube { - properties { - property "sonar.projectKey", "org.trellisldp:trellis" - property "sonar.projectName", "Trellis Linked Data Server" - property "sonar.links.homepage", "https://www.trellisldp.org" - property "sonar.links.issue", "https://github.com/trellis-ldp/trellis/issues" - property "sonar.links.scm_dev", "scm:git:git@github.com:trellis-ldp/trellis.git" - property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml" - } - } - - // Ignore alpha, beta, milestone and release candidates - dependencyUpdates.resolutionStrategy { - componentSelection { rules -> - rules.all { ComponentSelection selection -> - boolean rejected = ['alpha', 'beta', 'b', 'cr', 'rc', 'm', 'mr'].any { qualifier -> - selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ - } - if (rejected) { - selection.reject("Release Candidate") - } - } - } - } - - task jacocoMerge(type: JacocoMerge) { - subprojects.findAll { ! omitFromJacocoReporting.contains(it.name) } - .each { subproj -> - executionData fileTree(dir: "${subproj.buildDir}/jacoco", include: '*.exec') - dependsOn subproj.tasks.withType(Test) - } - } - - task jacocoRootReport(type: JacocoReport, dependsOn: jacocoMerge) { - sourceDirectories.from(files(subprojects - .findAll { ! omitFromJacocoReporting.contains(it.name) } - .sourceSets.main.allSource.srcDirs)) - classDirectories.from(files(subprojects - .findAll { ! omitFromJacocoReporting.contains(it.name) } - .sourceSets.main.output)) - executionData jacocoMerge.destinationFile - reports { - html.enabled = true - xml.enabled = true - csv.enabled = false - } - } - - buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' - } - - task getVersion { - doLast { - println project.version - } - } -} diff --git a/buildtools/src/main/resources/checkstyle/checkstyle.xml b/buildtools/src/main/resources/checkstyle/checkstyle.xml index ea3390381..75048fdbc 100644 --- a/buildtools/src/main/resources/checkstyle/checkstyle.xml +++ b/buildtools/src/main/resources/checkstyle/checkstyle.xml @@ -4,11 +4,6 @@ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> - - - - - @@ -87,7 +82,7 @@ - + diff --git a/buildtools/src/main/resources/checkstyle/suppressions.xml b/buildtools/src/main/resources/checkstyle/suppressions.xml index e29935d7d..5617762a6 100644 --- a/buildtools/src/main/resources/checkstyle/suppressions.xml +++ b/buildtools/src/main/resources/checkstyle/suppressions.xml @@ -9,6 +9,7 @@ + diff --git a/buildtools/src/main/resources/docker/publishToDockerHub.sh b/buildtools/src/main/resources/docker/publishToDockerHub.sh index d094b8d39..1ccd6e4ba 100755 --- a/buildtools/src/main/resources/docker/publishToDockerHub.sh +++ b/buildtools/src/main/resources/docker/publishToDockerHub.sh @@ -1,39 +1,14 @@ #!/bin/bash -VERSION=$(./gradlew -q getVersion) +VERSION=$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout) BRANCH=$(git branch 2>/dev/null | sed -n -e 's/^\* \(.*\)/\1/p') -cd platform/quarkus ################################## # Quarkus-based triplestore image ################################## IMAGE=trellisldp/trellis-triplestore -../../gradlew assemble -Ptriplestore - -TAG=latest -# Use the develop tag for snapshots -if [[ $VERSION == *SNAPSHOT* ]]; then - TAG=develop -fi - -# Don't use latest/develop tags for maintenance branches -if [[ $BRANCH == *.x ]]; then - docker build -f src/main/docker/Dockerfile.jvm -t "$IMAGE:$VERSION" . - docker push "$IMAGE:$VERSION" -else - docker build -f src/main/docker/Dockerfile.jvm -t "$IMAGE:$TAG" -t "$IMAGE:$VERSION" . - docker push "$IMAGE:$TAG" - docker push "$IMAGE:$VERSION" -fi - - -############################### -# Quarkus-based database image -############################### -IMAGE=trellisldp/trellis-postgresql - -../../gradlew assemble +./mvnw package -pl platform/quarkus -am TAG=latest # Use the develop tag for snapshots @@ -41,6 +16,7 @@ if [[ $VERSION == *SNAPSHOT* ]]; then TAG=develop fi +cd platform/quarkus # Don't use latest/develop tags for maintenance branches if [[ $BRANCH == *.x ]]; then docker build -f src/main/docker/Dockerfile.jvm -t "$IMAGE:$VERSION" . @@ -51,4 +27,3 @@ else docker push "$IMAGE:$VERSION" fi - diff --git a/buildtools/src/main/resources/docker/publishToGitHub.sh b/buildtools/src/main/resources/docker/publishToGitHub.sh index 23ddbe538..8fdd17967 100755 --- a/buildtools/src/main/resources/docker/publishToGitHub.sh +++ b/buildtools/src/main/resources/docker/publishToGitHub.sh @@ -1,28 +1,18 @@ #!/bin/bash -VERSION=$(./gradlew -q getVersion) +VERSION=$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout) # Publish releases only if [[ $VERSION != *SNAPSHOT* ]]; then + ./mvnw package -pl platform/quarkus -am + cd platform/quarkus ################################## # Quarkus-based triplestore image ################################## IMAGE=docker.pkg.github.com/trellis-ldp/trellis/trellis-triplestore - ../../gradlew assemble -Ptriplestore - - docker build -f src/main/docker/Dockerfile.jvm -t "$IMAGE:$VERSION" . - docker push "$IMAGE:$VERSION" - - ############################### - # Quarkus-based database image - ############################### - IMAGE=docker.pkg.github.com/trellis-ldp/trellis/trellis-postgresql - - ../../gradlew assemble - docker build -f src/main/docker/Dockerfile.jvm -t "$IMAGE:$VERSION" . docker push "$IMAGE:$VERSION" fi diff --git a/buildtools/src/main/resources/pmd/pmd.xml b/buildtools/src/main/resources/pmd/pmd.xml index 9d18cf403..5323480ad 100644 --- a/buildtools/src/main/resources/pmd/pmd.xml +++ b/buildtools/src/main/resources/pmd/pmd.xml @@ -21,7 +21,6 @@ - diff --git a/components/app/build.gradle b/components/app/build.gradle deleted file mode 100644 index d8252f761..000000000 --- a/components/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Application' - -ext { - moduleName = 'org.trellisldp.app' - testModules = ['org.trellisldp.file', 'org.trellisldp.constraint', 'org.trellisldp.audit', - 'org.trellisldp.jena', 'org.trellisldp.rdfa', 'smallrye.config'] -} - -dependencies { - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api project(':trellis-api') - api project(':trellis-common') - api project(':trellis-vocabulary') - - implementation "org.slf4j:slf4j-api:$slf4jVersion" - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "jakarta.el:jakarta.el-api:$elVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation("org.jboss.weld:weld-junit5:$weldVersion") { - exclude group: "org.jboss.spec.javax.interceptor", module: "jboss-interceptors-api_1.2_spec" - exclude group: "org.jboss.spec.javax.el", module: "jboss-el-api_3.0_spec" - } - - testImplementation project(':trellis-audit') - testImplementation project(':trellis-constraint') - testImplementation project(':trellis-file') - testImplementation project(':trellis-jena') - testImplementation project(':trellis-rdfa') - testImplementation project(':trellis-triplestore') -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - -test { - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "org.trellisldp.api/org.trellisldp.api=weld.core.impl", - '--add-opens', "org.trellisldp.common/org.trellisldp.common=weld.core.impl", - '--add-opens', "org.trellisldp.constraint/org.trellisldp.constraint=weld.core.impl", - '--add-opens', "org.trellisldp.file/org.trellisldp.file=weld.core.impl", - '--add-opens', "org.trellisldp.jena/org.trellisldp.jena=weld.core.impl", - '--add-opens', "java.base/java.lang=weld.core.impl", - ] - } -} diff --git a/components/app/pom.xml b/components/app/pom.xml new file mode 100644 index 000000000..24bba430c --- /dev/null +++ b/components/app/pom.xml @@ -0,0 +1,150 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-app + 0.20.0-SNAPSHOT + Trellis Application + https://www.trellisldp.org + + Trellis LDP Application + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.apache.commons + commons-rdf-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.activation + jakarta.activation-api + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-audit + ${project.version} + test + + + org.trellisldp + trellis-jena + ${project.version} + test + + + org.trellisldp + trellis-constraint + ${project.version} + test + + + org.trellisldp + trellis-triplestore + ${project.version} + test + + + org.trellisldp + trellis-rdfa + ${project.version} + test + + + org.trellisldp + trellis-file + ${project.version} + test + + + org.mockito + mockito-core + test + + + io.smallrye.config + smallrye-config + test + + + jakarta.el + jakarta.el-api + test + + + org.jboss.weld + weld-junit5 + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.lang=ALL-UNNAMED + + + + + + diff --git a/components/app/src/main/java/module-info.java b/components/app/src/main/java/module-info.java index bacede6ef..f7102d387 100644 --- a/components/app/src/main/java/module-info.java +++ b/components/app/src/main/java/module-info.java @@ -23,5 +23,7 @@ requires jakarta.inject; requires jakarta.enterprise.cdi.api; + requires org.slf4j; + opens org.trellisldp.app; } diff --git a/components/app/src/test/resources/logback-test.xml b/components/app/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/app/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/app/src/test/resources/simplelogger.properties b/components/app/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/app/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/audit/build.gradle b/components/audit/build.gradle deleted file mode 100644 index 7e2878bf4..000000000 --- a/components/audit/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Audit' - -ext { - moduleName = 'org.trellisldp.audit' - testModules = ['org.apache.commons.rdf.simple'] -} - -dependencies { - api project(':trellis-api') - - implementation project(':trellis-vocabulary') - - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/audit/pom.xml b/components/audit/pom.xml new file mode 100644 index 000000000..415bdc393 --- /dev/null +++ b/components/audit/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-audit + 0.20.0-SNAPSHOT + Trellis Audit + https://www.trellisldp.org + + Trellis LDP Default Audit module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.apache.commons + commons-rdf-api + + + + + org.apache.commons + commons-rdf-simple + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/cache/build.gradle b/components/cache/build.gradle deleted file mode 100644 index 24167e265..000000000 --- a/components/cache/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = "Trellis Cache Implementation" - -ext { - moduleName = 'org.trellisldp.cache' -} - -dependencies { - api project(':trellis-api') - api "com.google.guava:guava:$guavaVersion" - - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/cache/pom.xml b/components/cache/pom.xml new file mode 100644 index 000000000..f950775b1 --- /dev/null +++ b/components/cache/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-cache + 0.20.0-SNAPSHOT + Trellis Cache + https://www.trellisldp.org + + Trellis LDP Cache module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + com.google.guava + guava + + + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/cdi/build.gradle b/components/cdi/build.gradle deleted file mode 100644 index 6b01e32a7..000000000 --- a/components/cdi/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis CDI component' - -ext { - moduleName = 'org.trellisldp.cdi' - testModules = ['org.trellisldp.constraint'] -} - -dependencies { - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api project(':trellis-api') - api project(':trellis-app') - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "jakarta.el:jakarta.el-api:$elVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" - testImplementation("org.jboss.weld:weld-junit5:$weldVersion") { - exclude group: "org.jboss.spec.javax.interceptor", module: "jboss-interceptors-api_1.2_spec" - exclude group: "org.jboss.spec.javax.el", module: "jboss-el-api_3.0_spec" - } - - testImplementation project(':trellis-constraint') -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - -test { - systemProperty 'trellis.file.binary-path', "./build/data" - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "org.trellisldp.api/org.trellisldp.api=weld.core.impl", - '--add-opens', "org.trellisldp.constraint/org.trellisldp.constraint=weld.core.impl", - '--add-opens', "java.base/java.lang=weld.core.impl", - ] - } -} diff --git a/components/cdi/pom.xml b/components/cdi/pom.xml new file mode 100644 index 000000000..bc30d1c95 --- /dev/null +++ b/components/cdi/pom.xml @@ -0,0 +1,103 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-cdi + 0.20.0-SNAPSHOT + Trellis CDI + https://www.trellisldp.org + + Trellis LDP CDI module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-app + ${project.version} + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.activation + jakarta.activation-api + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-constraint + ${project.version} + test + + + org.apache.commons + commons-rdf-simple + test + + + org.mockito + mockito-core + test + + + io.smallrye.config + smallrye-config + test + + + jakarta.el + jakarta.el-api + test + + + org.jboss.weld + weld-junit5 + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.lang=ALL-UNNAMED + + + + + + diff --git a/components/cdi/src/test/resources/logback-test.xml b/components/cdi/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/cdi/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/cdi/src/test/resources/simplelogger.properties b/components/cdi/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/cdi/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/constraint/build.gradle b/components/constraint/build.gradle deleted file mode 100644 index 126846c2a..000000000 --- a/components/constraint/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Constraint Rules' - -ext { - moduleName = 'org.trellisldp.constraint' - testModules = ['org.apache.jena.commonsrdf'] -} - -dependencies { - api project(':trellis-api') - - implementation project(':trellis-vocabulary') - - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/constraint/pom.xml b/components/constraint/pom.xml new file mode 100644 index 000000000..896da0f0e --- /dev/null +++ b/components/constraint/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-constraint + 0.20.0-SNAPSHOT + Trellis Constraints + https://www.trellisldp.org + + Trellis LDP Default Constraint module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.apache.commons + commons-rdf-api + + + + + org.apache.jena + jena-commonsrdf + test + + + org.mockito + mockito-core + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/constraint/src/test/resources/logback-test.xml b/components/constraint/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/constraint/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/constraint/src/test/resources/simplelogger.properties b/components/constraint/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/constraint/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/file/build.gradle b/components/file/build.gradle deleted file mode 100644 index 980eb4b34..000000000 --- a/components/file/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis File' - -ext { - moduleName = 'org.trellisldp.file' - testModules = ['smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api project(':trellis-api') - - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "commons-io:commons-io:$commonsIoVersion" - implementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/file/pom.xml b/components/file/pom.xml new file mode 100644 index 000000000..5c90a66f8 --- /dev/null +++ b/components/file/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-file + 0.20.0-SNAPSHOT + Trellis File + https://www.trellisldp.org + + Trellis LDP File persistence module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-commonsrdf + + + commons-codec + commons-codec + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + + + io.smallrye.config + smallrye-config + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/file/src/main/java/module-info.java b/components/file/src/main/java/module-info.java index 3f2a20f64..b33d2cf8d 100644 --- a/components/file/src/main/java/module-info.java +++ b/components/file/src/main/java/module-info.java @@ -28,6 +28,7 @@ requires org.slf4j; requires jakarta.enterprise.cdi.api; requires jakarta.inject; + requires java.annotation; requires microprofile.config.api; requires org.apache.commons.codec; requires org.apache.jena.core; diff --git a/components/file/src/test/resources/logback-test.xml b/components/file/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/file/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/file/src/test/resources/simplelogger.properties b/components/file/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/file/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/jdbc/build.gradle b/components/jdbc/build.gradle deleted file mode 100644 index 3fc2fbaf9..000000000 --- a/components/jdbc/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis JDBC component' - -configurations { - testcontainers -} - -ext { - moduleName = 'org.trellisldp.jdbc' - testModules = ['smallrye.config', 'org.trellisldp.test', 'liquibase.core', 'java.naming'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "org.apache.commons:commons-lang3:$commonsLangVersion" - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api "org.apache.jena:jena-arq:$jenaVersion" - api "org.apache.jena:jena-commonsrdf:$jenaVersion" - api "org.eclipse.microprofile.health:microprofile-health-api" - api "org.jdbi:jdbi3-core:$jdbiVersion" - api project(":trellis-api") - - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(":trellis-vocabulary") - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "com.google.guava:guava:$guavaVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation("io.smallrye:smallrye-health:$smallryeHealthVersion") { - exclude group: 'io.smallrye', module: 'smallrye-health-extension-api' - } - testImplementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - testImplementation "org.apache.commons:commons-text:$commonsTextVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.yaml:snakeyaml:$snakeyamlVersion" - testImplementation "org.liquibase:liquibase-core:$liquibaseVersion" - testImplementation "org.postgresql:postgresql:$postgresVersion" - - testImplementation project(":trellis-test") - - testcontainers "org.testcontainers:postgresql:$testcontainersVersion" -} - -compileTestJava { - inputs.property("moduleName", moduleName) - doFirst { - options.compilerArgs += [ - '--add-reads', "$moduleName=ALL-UNNAMED", - ] - classpath = files(configurations.testcontainers) - } -} - -test { - inputs.property("moduleName", moduleName) - - systemProperty "trellis.jdbc.test.postgres-container-version", postgresContainerVersion - - doFirst { - jvmArgs += [ - '--add-reads', "$moduleName=ALL-UNNAMED", - ] - classpath = files(configurations.testcontainers) - } -} diff --git a/components/jdbc/pom.xml b/components/jdbc/pom.xml new file mode 100644 index 000000000..50f262236 --- /dev/null +++ b/components/jdbc/pom.xml @@ -0,0 +1,165 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-jdbc + 0.20.0-SNAPSHOT + Trellis JDBC + https://www.trellisldp.org + + Trellis LDP JDBC persistence module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.eclipse.microprofile.health + microprofile-health-api + + + org.apache.commons + commons-rdf-api + + + org.apache.commons + commons-lang3 + + + org.apache.jena + jena-arq + + + org.apache.jena + jena-commonsrdf + + + org.jdbi + jdbi3-core + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-test + ${project.version} + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + com.google.guava + guava + test + + + io.smallrye.config + smallrye-config + test + + + io.smallrye + smallrye-health + test + + + jakarta.xml.bind + jakarta.xml.bind-api + test + + + org.apache.commons + commons-text + test + + + org.yaml + snakeyaml + test + + + org.liquibase + liquibase-core + test + + + org.postgresql + postgresql + test + + + org.testcontainers + postgresql + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + 10.8 + + + + + + diff --git a/components/jdbc/src/main/java/module-info.java b/components/jdbc/src/main/java/module-info.java index 8d5136041..ec1113f9b 100644 --- a/components/jdbc/src/main/java/module-info.java +++ b/components/jdbc/src/main/java/module-info.java @@ -22,12 +22,14 @@ requires org.apache.commons.lang3; requires org.apache.commons.rdf.api; requires org.apache.jena.arq; + requires org.apache.jena.core; requires org.apache.jena.commonsrdf; requires org.jdbi.v3.core; requires org.slf4j; requires jakarta.enterprise.cdi.api; requires jakarta.inject; + requires java.naming; requires java.annotation; requires java.sql; requires microprofile.config.api; diff --git a/components/jdbc/src/test/resources/logback-test.xml b/components/jdbc/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/jdbc/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/jdbc/src/test/resources/simplelogger.properties b/components/jdbc/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/jdbc/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/jena/build.gradle b/components/jena/build.gradle deleted file mode 100644 index c26f2c519..000000000 --- a/components/jena/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Jena IO Layer' - -ext { - moduleName = 'org.trellisldp.jena' - testModules = ['smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "org.apache.jena:jena-commonsrdf:$jenaVersion" - api project(':trellis-api') - - implementation "commons-io:commons-io:$commonsIoVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/jena/pom.xml b/components/jena/pom.xml new file mode 100644 index 000000000..b43c1dc23 --- /dev/null +++ b/components/jena/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-jena + 0.20.0-SNAPSHOT + Trellis Jena + https://www.trellisldp.org + + Trellis LDP Jena RDF module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-commonsrdf + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/jena/src/main/java/module-info.java b/components/jena/src/main/java/module-info.java index 92ef81d97..6e6760508 100644 --- a/components/jena/src/main/java/module-info.java +++ b/components/jena/src/main/java/module-info.java @@ -27,6 +27,7 @@ requires org.apache.jena.core; requires jakarta.enterprise.cdi.api; requires jakarta.inject; + requires java.annotation; requires microprofile.config.api; requires org.slf4j; diff --git a/components/jena/src/main/java/org/trellisldp/jena/JenaIOService.java b/components/jena/src/main/java/org/trellisldp/jena/JenaIOService.java index ef475e3c3..d69ddaa2f 100644 --- a/components/jena/src/main/java/org/trellisldp/jena/JenaIOService.java +++ b/components/jena/src/main/java/org/trellisldp/jena/JenaIOService.java @@ -370,7 +370,7 @@ static boolean shouldUseRelativeIRIs(final boolean defaultValue, final IRI... pr return defaultValue; } - private static class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { + private static final class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { @Override public ReaderRIOT create(final Lang language, final ParserProfile profile) { // force the use of jsonld-java (i.e., JSON-LD 1.0) diff --git a/components/jena/src/test/resources/logback-test.xml b/components/jena/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/jena/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/jena/src/test/resources/simplelogger.properties b/components/jena/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/jena/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/namespace/build.gradle b/components/namespace/build.gradle deleted file mode 100644 index 0f2e9cbff..000000000 --- a/components/namespace/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis Namespaces' - -ext { - moduleName = 'org.trellisldp.namespace' - testModules = ['org.apache.commons.rdf.simple', 'smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api project(':trellis-api') - - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" -} - diff --git a/components/namespace/pom.xml b/components/namespace/pom.xml new file mode 100644 index 000000000..5d5836628 --- /dev/null +++ b/components/namespace/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-namespace + 0.20.0-SNAPSHOT + Trellis Namespaces + https://www.trellisldp.org + + Trellis LDP Namespace module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.apache.commons + commons-rdf-api + + + org.slf4j + slf4j-api + + + + + org.apache.jena + jena-commonsrdf + test + + + org.mockito + mockito-core + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/namespace/src/main/java/module-info.java b/components/namespace/src/main/java/module-info.java index 97a53a627..3233fed42 100644 --- a/components/namespace/src/main/java/module-info.java +++ b/components/namespace/src/main/java/module-info.java @@ -22,6 +22,7 @@ requires org.apache.commons.rdf.api; requires jakarta.enterprise.cdi.api; requires jakarta.inject; + requires java.annotation; requires microprofile.config.api; requires org.slf4j; diff --git a/components/namespace/src/test/resources/logback-test.xml b/components/namespace/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/namespace/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/namespace/src/test/resources/simplelogger.properties b/components/namespace/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/namespace/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/pom.xml b/components/pom.xml new file mode 100644 index 000000000..09add6874 --- /dev/null +++ b/components/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../parent + + + org.trellisldp + trellis-components-parent + 0.20.0-SNAPSHOT + Trellis Components parent + https://www.trellisldp.org + + + Trellis LDP server: component modules + + pom + + + app + audit + cache + cdi + constraint + file + jdbc + jena + namespace + rdfa + test + triplestore + webdav + + diff --git a/components/rdfa/build.gradle b/components/rdfa/build.gradle deleted file mode 100644 index d5c92128c..000000000 --- a/components/rdfa/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis RDFa' - -ext { - moduleName = 'org.trellisldp.rdfa' - testModules = ['org.apache.jena.commonsrdf', 'smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api project(':trellis-api') - - implementation "com.github.spullara.mustache.java:compiler:$mustacheVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation project(':trellis-vocabulary') - - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/components/rdfa/pom.xml b/components/rdfa/pom.xml new file mode 100644 index 000000000..1cbef6a3f --- /dev/null +++ b/components/rdfa/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-rdfa + 0.20.0-SNAPSHOT + Trellis RDFa + https://www.trellisldp.org + + Trellis LDP RDFa component + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-arq + + + com.github.spullara.mustache.java + compiler + + + + + org.apache.jena + jena-commonsrdf + test + + + io.smallrye.config + smallrye-config + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/rdfa/src/main/java/module-info.java b/components/rdfa/src/main/java/module-info.java index 06076747c..98e93512c 100644 --- a/components/rdfa/src/main/java/module-info.java +++ b/components/rdfa/src/main/java/module-info.java @@ -22,10 +22,12 @@ requires com.github.mustachejava; requires jakarta.enterprise.cdi.api; requires jakarta.inject; + requires java.annotation; requires microprofile.config.api; requires org.apache.commons.rdf.api; requires org.apache.jena.arq; requires org.apache.jena.core; + requires org.slf4j; uses org.trellisldp.api.NamespaceService; diff --git a/components/rdfa/src/test/resources/logback-test.xml b/components/rdfa/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/rdfa/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/rdfa/src/test/resources/simplelogger.properties b/components/rdfa/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/rdfa/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/test/build.gradle b/components/test/build.gradle deleted file mode 100644 index c917fcd27..000000000 --- a/components/test/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -plugins { - id 'java-library' -} - -description = 'Trellis Test' - -ext { - moduleName = 'org.trellisldp.test' -} - -sonarqube { - skipProject = true -} - -dependencies { - api platform("org.junit:junit-bom:$junitVersion") - - api "org.junit.jupiter:junit-jupiter-api" - - implementation platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - implementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion") - - implementation "com.fasterxml.jackson.core:jackson-core" - implementation "com.fasterxml.jackson.core:jackson-databind" - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "commons-io:commons-io:$commonsIoVersion" - implementation "io.smallrye:smallrye-jwt-build:$smallryeJwtVersion" - implementation "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.apache.commons:commons-text:$commonsTextVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - implementation("org.awaitility:awaitility:$awaitilityVersion") { - exclude group: 'org.hamcrest', module: 'hamcrest-library' - exclude group: 'org.hamcrest', module: 'hamcrest-core' - } - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.junit.jupiter:junit-jupiter-engine" - implementation "org.hamcrest:hamcrest:$hamcrestVersion" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-api') - implementation project(':trellis-jena') - implementation project(':trellis-common') - implementation project(':trellis-vocabulary') - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" -} - -jar { - manifest { - attributes('Automatic-Module-Name': moduleName) - } -} - -pmd { - consoleOutput = false -} diff --git a/components/test/pom.xml b/components/test/pom.xml new file mode 100644 index 000000000..b8d876fdb --- /dev/null +++ b/components/test/pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-test + 0.20.0-SNAPSHOT + Trellis Test + https://www.trellisldp.org + + Trellis LDP Test module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.trellisldp + trellis-jena + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-arq + + + org.apache.jena + jena-commonsrdf + + + commons-codec + commons-codec + + + commons-io + commons-io + + + org.apache.commons + commons-text + + + io.smallrye + smallrye-jwt-build + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + org.junit.jupiter + junit-jupiter-api + + + org.junit.jupiter + junit-jupiter-engine + + + org.hamcrest + hamcrest + + + org.awaitility + awaitility + + + org.slf4j + slf4j-api + + + + + org.mockito + mockito-core + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/test/src/main/java/module-info.java b/components/test/src/main/java/module-info.java deleted file mode 100644 index 95f5aa1ac..000000000 --- a/components/test/src/main/java/module-info.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Aaron Coburn and individual contributors - * - * Licensed 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. - */ -module org.trellisldp.test { - exports org.trellisldp.test; - - requires org.trellisldp.api; - requires org.trellisldp.common; - requires org.trellisldp.jena; - requires org.trellisldp.vocabulary; - - requires com.fasterxml.jackson.core; - requires com.fasterxml.jackson.databind; - requires org.apache.commons.codec; - requires org.apache.commons.io; - requires org.apache.commons.rdf.api; - requires org.apache.jena.arq; - requires org.apache.jena.commonsrdf; - requires org.junit.jupiter.api; - requires org.slf4j; - - requires java.annotation; - requires java.ws.rs; - requires java.xml.bind; - requires jakarta.inject; - - requires awaitility; - requires smallrye.jwt.build; - - opens org.trellisldp.test; -} diff --git a/components/test/src/main/java/org/trellisldp/test/TestUtils.java b/components/test/src/main/java/org/trellisldp/test/TestUtils.java index b7f5d6400..524acdb2b 100644 --- a/components/test/src/main/java/org/trellisldp/test/TestUtils.java +++ b/components/test/src/main/java/org/trellisldp/test/TestUtils.java @@ -31,6 +31,7 @@ import java.io.InputStream; import java.io.UncheckedIOException; import java.time.Instant; +import java.util.Collections; import java.util.List; import java.util.function.Predicate; @@ -159,7 +160,8 @@ public static String getResourceAsString(final String path) { */ public static List getLinks(final Response res) { // Jersey's client doesn't parse complex link headers correctly - return res.getStringHeaders().get(LINK).stream().map(Link::valueOf).collect(toList()); + return res.getStringHeaders().getOrDefault(LINK, Collections.emptyList()).stream().map(Link::valueOf) + .collect(toList()); } /** diff --git a/components/test/src/test/resources/logback-test.xml b/components/test/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/test/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/test/src/test/resources/simplelogger.properties b/components/test/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/test/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/triplestore/build.gradle b/components/triplestore/build.gradle deleted file mode 100644 index b2384cc2a..000000000 --- a/components/triplestore/build.gradle +++ /dev/null @@ -1,43 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis Triplestore' - -ext { - moduleName = 'org.trellisldp.triplestore' - testModules = ['smallrye.config', 'org.trellisldp.test', 'org.trellisldp.audit'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - api "org.apache.jena:jena-rdfconnection:$jenaVersion" - api "org.apache.jena:jena-arq:$jenaVersion" - api "org.eclipse.microprofile.health:microprofile-health-api" - api project(':trellis-api') - - implementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - implementation "org.apache.jena:jena-tdb2:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation("io.smallrye:smallrye-health:$smallryeHealthVersion") { - exclude group: 'io.smallrye', module: 'smallrye-health-extension-api' - } - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation project(':trellis-audit') - testImplementation project(':trellis-test') - testImplementation("org.awaitility:awaitility:$awaitilityVersion") { - exclude group: "org.hamcrest", module: 'hamcrest-core' - exclude group: 'org.hamcrest', module: 'hamcrest-library' - } - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" -} diff --git a/components/triplestore/pom.xml b/components/triplestore/pom.xml new file mode 100644 index 000000000..a71d28eef --- /dev/null +++ b/components/triplestore/pom.xml @@ -0,0 +1,123 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-triplestore + 0.20.0-SNAPSHOT + Trellis Triplestore + https://www.trellisldp.org + + Trellis LDP Triplestore persistence module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.inject + jakarta.inject-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.eclipse.microprofile.health + microprofile-health-api + + + org.apache.commons + commons-rdf-api + + + org.apache.jena + jena-arq + + + org.apache.jena + jena-rdfconnection + + + org.apache.jena + jena-commonsrdf + + + org.apache.jena + jena-tdb2 + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-audit + ${project.version} + test + + + org.trellisldp + trellis-test + ${project.version} + test + + + io.smallrye + smallrye-health + test + + + io.smallrye.config + smallrye-config + test + + + org.hamcrest + hamcrest + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/components/triplestore/src/test/java/org/trellisldp/triplestore/RDFConnectionProviderTest.java b/components/triplestore/src/test/java/org/trellisldp/triplestore/RDFConnectionProviderTest.java index 63264f404..cc4f707f0 100644 --- a/components/triplestore/src/test/java/org/trellisldp/triplestore/RDFConnectionProviderTest.java +++ b/components/triplestore/src/test/java/org/trellisldp/triplestore/RDFConnectionProviderTest.java @@ -45,7 +45,8 @@ void testRDFConnectionRemote() { @Test void testRDFConnectionLocal() throws Exception { - final File dir = new File(new File(getClass().getResource("/logback-test.xml").toURI()).getParent(), "data2"); + final File dir = new File(new File(getClass().getResource("/simplelogger.properties").toURI()).getParent(), + "data2"); final RDFConnectionProvider provider = new RDFConnectionProvider(); provider.connectionString = Optional.of(dir.getAbsolutePath()); provider.init(); diff --git a/components/triplestore/src/test/java/org/trellisldp/triplestore/TriplestoreResourceServiceTest.java b/components/triplestore/src/test/java/org/trellisldp/triplestore/TriplestoreResourceServiceTest.java index c2d361679..552b5461b 100644 --- a/components/triplestore/src/test/java/org/trellisldp/triplestore/TriplestoreResourceServiceTest.java +++ b/components/triplestore/src/test/java/org/trellisldp/triplestore/TriplestoreResourceServiceTest.java @@ -1326,7 +1326,8 @@ void testBuildRDFConnectionMemory() { @Test void testBuildRDFConnectionTDB() throws Exception { - final File dir = new File(new File(getClass().getResource("/logback-test.xml").toURI()).getParent(), "data"); + final File dir = new File(new File(getClass().getResource("/simplelogger.properties").toURI()).getParent(), + "data"); final RDFConnection rdfConnection = TriplestoreResourceService.buildRDFConnection(dir.getAbsolutePath()); assertNotNull(rdfConnection, "Missing RDFConnection, using local file!"); assertFalse(rdfConnection.isClosed(), "RDFConnection has been closed!"); diff --git a/components/triplestore/src/test/resources/logback-test.xml b/components/triplestore/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/triplestore/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/triplestore/src/test/resources/simplelogger.properties b/components/triplestore/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/triplestore/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/components/webdav/build.gradle b/components/webdav/build.gradle deleted file mode 100644 index 25d5dc235..000000000 --- a/components/webdav/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis WebDAV' - -ext { - moduleName = 'org.trellisldp.webdav' - testModules = ['org.trellisldp.jena', 'org.trellisldp.http', 'org.trellisldp.audit', 'smallrye.config'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:${cdiApiVersion}" - api "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api "org.eclipse.microprofile.metrics:microprofile-metrics-api" - api project(':trellis-api') - - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.apache.commons:commons-lang3:$commonsLangVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-common') - implementation project(':trellis-vocabulary') - - testImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") - - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" - testImplementation "org.glassfish.jersey.core:jersey-server" - testImplementation "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2" - testImplementation "org.glassfish.jersey.inject:jersey-hk2" - testImplementation "org.glassfish.jersey.connectors:jersey-apache-connector" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation project(':trellis-http') - testImplementation project(':trellis-audit') - testImplementation project(':trellis-constraint') - testImplementation project(':trellis-jena') - testImplementation project(':trellis-notification-jackson') - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" - testRuntimeOnly "org.glassfish.jaxb:jaxb-runtime:$glassfishJaxbVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - -test { - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "java.base/java.net=jersey.client", - '--add-opens', "$moduleName/org.trellisldp.webdav.impl=org.junit.platform.commons", - '--add-opens', "$moduleName/org.trellisldp.webdav.impl=org.mockito", - '--add-opens', "$moduleName/$moduleName=hk2.utils", - '--add-opens', "org.trellisldp.http/org.trellisldp.http=hk2.utils", - ] - } - mustRunAfter(':trellis-http:test') -} diff --git a/components/webdav/pom.xml b/components/webdav/pom.xml new file mode 100644 index 000000000..e3c5181e2 --- /dev/null +++ b/components/webdav/pom.xml @@ -0,0 +1,174 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-webdav + 0.20.0-SNAPSHOT + Trellis WebDAV + https://www.trellisldp.org + + Trellis LDP WebDAV API + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + jakarta.inject + jakarta.inject-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.annotation + jakarta.annotation-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + + + org.apache.commons + commons-rdf-api + + + org.apache.commons + commons-lang3 + + + org.apache.jena + jena-arq + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-http + ${project.version} + test + + + org.trellisldp + trellis-audit + ${project.version} + test + + + org.trellisldp + trellis-constraint + ${project.version} + test + + + org.trellisldp + trellis-jena + ${project.version} + test + + + io.smallrye.config + smallrye-config + test + + + org.apache.commons + commons-rdf-simple + test + + + org.glassfish.jersey.inject + jersey-hk2 + test + + + org.glassfish.jersey.connectors + jersey-apache-connector + test + + + org.glassfish.jersey.core + jersey-server + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + test + + + org.glassfish.jaxb + jaxb-runtime + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.mockito + mockito-core + test + + + org.slf4j + slf4j-simple + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.net=ALL-UNNAMED + + + + + + diff --git a/components/webdav/src/main/java/module-info.java b/components/webdav/src/main/java/module-info.java index 6f2a31dff..a373c536c 100644 --- a/components/webdav/src/main/java/module-info.java +++ b/components/webdav/src/main/java/module-info.java @@ -24,6 +24,7 @@ requires org.apache.commons.rdf.api; requires org.apache.commons.lang3; requires org.apache.jena.arq; + requires org.apache.jena.core; requires org.slf4j; requires microprofile.metrics.api; diff --git a/components/webdav/src/test/resources/logback-test.xml b/components/webdav/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/components/webdav/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/components/webdav/src/test/resources/simplelogger.properties b/components/webdav/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/components/webdav/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/core/api/build.gradle b/core/api/build.gradle deleted file mode 100644 index 79d0c5315..000000000 --- a/core/api/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis API' - -ext { - moduleName = 'org.trellisldp.api' - testModules = ['org.trellisldp.vocabulary', 'org.apache.jena.commonsrdf'] -} - -dependencies { - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - - testImplementation "commons-io:commons-io:$commonsIoVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.apache.commons:commons-text:$commonsTextVersion" - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation project(':trellis-vocabulary') - - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/core/api/pom.xml b/core/api/pom.xml new file mode 100644 index 000000000..2b0da11ae --- /dev/null +++ b/core/api/pom.xml @@ -0,0 +1,79 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-api + 0.20.0-SNAPSHOT + Trellis API + https://www.trellisldp.org + + Trellis LDP Core API + + jar + + + + org.apache.commons + commons-rdf-api + + + jakarta.inject + jakarta.inject-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + + + org.trellisldp + trellis-vocabulary + ${project.version} + test + + + org.apache.jena + jena-commonsrdf + test + + + commons-io + commons-io + test + + + org.apache.commons + commons-text + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/core/api/src/test/resources/logback-test.xml b/core/api/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/core/api/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/core/api/src/test/resources/simplelogger.properties b/core/api/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/core/api/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/core/common/build.gradle b/core/common/build.gradle deleted file mode 100644 index f3d6a589f..000000000 --- a/core/common/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis Common Components' - -ext { - moduleName = 'org.trellisldp.common' - testModules = ['smallrye.config', 'org.apache.jena.commonsrdf'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api project(':trellis-api') - api project(':trellis-vocabulary') - - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.apache.commons:commons-lang3:$commonsLangVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - - testImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") - - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation "org.glassfish.jersey.core:jersey-common" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" -} - diff --git a/core/common/pom.xml b/core/common/pom.xml new file mode 100644 index 000000000..26976af43 --- /dev/null +++ b/core/common/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-common + 0.20.0-SNAPSHOT + Trellis Common Utilities + https://www.trellisldp.org + + Trellis LDP Common utilities and components + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + commons-codec + commons-codec + + + org.apache.commons + commons-rdf-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.xml.bind + jakarta.xml.bind-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.slf4j + slf4j-api + + + org.apache.commons + commons-lang3 + + + + + org.apache.jena + jena-commonsrdf + test + + + org.apache.commons + commons-text + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.slf4j + slf4j-simple + test + + + io.smallrye.config + smallrye-config + test + + + org.glassfish.jersey.core + jersey-common + test + + + diff --git a/core/common/src/main/java/module-info.java b/core/common/src/main/java/module-info.java index 94aa2c42f..625c52e5a 100644 --- a/core/common/src/main/java/module-info.java +++ b/core/common/src/main/java/module-info.java @@ -21,6 +21,7 @@ requires org.apache.commons.codec; requires org.apache.commons.rdf.api; + requires org.apache.commons.lang3; requires org.slf4j; requires microprofile.config.api; diff --git a/core/http/build.gradle b/core/http/build.gradle deleted file mode 100644 index 92320d2c4..000000000 --- a/core/http/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis HTTP' - -ext { - moduleName = 'org.trellisldp.http' - testModules = ['org.trellisldp.jena', 'org.trellisldp.audit', 'org.trellisldp.constraint', 'smallrye.config', - 'com.fasterxml.jackson.databind', 'org.apache.jena.commonsrdf', 'com.fasterxml.jackson.core', - 'org.apache.commons.io'] -} - -dependencies { - api platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - api "org.eclipse.microprofile.metrics:microprofile-metrics-api" - api "org.eclipse.microprofile.openapi:microprofile-openapi-api" - api project(':trellis-api') - api project(':trellis-common') - - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - implementation "org.apache.commons:commons-lang3:$commonsLangVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation project(':trellis-vocabulary') - - testImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") - testImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion") - - testImplementation "com.fasterxml.jackson.core:jackson-core" - testImplementation "com.fasterxml.jackson.core:jackson-databind" - testImplementation "commons-io:commons-io:$commonsIoVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation "org.glassfish.jersey.core:jersey-server" - testImplementation "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2" - testImplementation "org.glassfish.jersey.inject:jersey-hk2" - testImplementation "org.glassfish.jersey.connectors:jersey-apache-connector" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation project(':trellis-audit') - testImplementation project(':trellis-constraint') - testImplementation project(':trellis-jena') - testImplementation project(':trellis-notification-jackson') - - testRuntimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" -} - -test { - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "$moduleName/$moduleName=hk2.utils", - '--add-opens', "$moduleName/org.trellisldp.http.impl=org.junit.platform.commons", - '--add-opens', "$moduleName/org.trellisldp.http.impl=org.mockito", - '--add-opens', "java.base/java.net=jersey.client", - ] - } -} diff --git a/core/http/pom.xml b/core/http/pom.xml new file mode 100644 index 000000000..4c0fe0690 --- /dev/null +++ b/core/http/pom.xml @@ -0,0 +1,182 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-http + 0.20.0-SNAPSHOT + Trellis HTTP + https://www.trellisldp.org + + Trellis LDP HTTP module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + commons-codec + commons-codec + + + org.apache.commons + commons-rdf-api + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + jakarta.xml.bind + jakarta.xml.bind-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + + + org.eclipse.microprofile.openapi + microprofile-openapi-api + + + org.slf4j + slf4j-api + + + org.apache.commons + commons-lang3 + + + + + org.trellisldp + trellis-audit + ${project.version} + test + + + org.trellisldp + trellis-constraint + ${project.version} + test + + + org.trellisldp + trellis-jena + ${project.version} + test + + + org.apache.jena + jena-commonsrdf + test + + + org.apache.commons + commons-text + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.slf4j + slf4j-simple + test + + + io.smallrye.config + smallrye-config + test + + + org.glassfish.jersey.core + jersey-common + test + + + org.glassfish.jersey.inject + jersey-hk2 + test + + + org.glassfish.jersey.connectors + jersey-apache-connector + test + + + org.glassfish.jersey.core + jersey-server + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.net=ALL-UNNAMED + + + + + + diff --git a/core/http/src/main/java/module-info.java b/core/http/src/main/java/module-info.java index 853f0df99..696e6ef31 100644 --- a/core/http/src/main/java/module-info.java +++ b/core/http/src/main/java/module-info.java @@ -31,4 +31,5 @@ requires java.ws.rs; requires java.xml.bind; requires microprofile.metrics.api; + requires microprofile.openapi.api; } diff --git a/core/http/src/test/resources/logback-test.xml b/core/http/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/core/http/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/core/http/src/test/resources/simplelogger.properties b/core/http/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/core/http/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/core/pom.xml b/core/pom.xml new file mode 100644 index 000000000..9e0286843 --- /dev/null +++ b/core/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../parent + + + org.trellisldp + trellis-core-parent + 0.20.0-SNAPSHOT + Trellis Core parent + https://www.trellisldp.org + + + Trellis LDP server: core components + + pom + + + api + common + http + vocabulary + + diff --git a/core/vocabulary/build.gradle b/core/vocabulary/build.gradle deleted file mode 100644 index eb43ab045..000000000 --- a/core/vocabulary/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis Vocabularies' - -ext { - moduleName = 'org.trellisldp.vocabulary' - testModules = ['org.apache.jena.commonsrdf'] -} - -dependencies { - api "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - - testImplementation "org.apache.jena:jena-arq:$jenaVersion" - testImplementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - - testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion" -} diff --git a/core/vocabulary/pom.xml b/core/vocabulary/pom.xml new file mode 100644 index 000000000..efd3817a5 --- /dev/null +++ b/core/vocabulary/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-vocabulary + 0.20.0-SNAPSHOT + Trellis Vocabularies + https://www.trellisldp.org + + Trellis LDP Vocabulary Definitions + + jar + + + + org.apache.commons + commons-rdf-api + + + + + org.apache.jena + jena-arq + test + + + org.apache.jena + jena-commonsrdf + test + + + org.mockito + mockito-core + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/core/vocabulary/src/test/java/org/trellisldp/vocabulary/ASTest.java b/core/vocabulary/src/test/java/org/trellisldp/vocabulary/ASTest.java index 334aed321..c877c093d 100644 --- a/core/vocabulary/src/test/java/org/trellisldp/vocabulary/ASTest.java +++ b/core/vocabulary/src/test/java/org/trellisldp/vocabulary/ASTest.java @@ -85,7 +85,7 @@ void checkUri() { assertEquals(namespace(), AS.getNamespace(), "AS namespace doesn't match expected value!"); } - private static class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { + private static final class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { @Override public ReaderRIOT create(final Lang language, final ParserProfile profile) { // force the use of jsonld-java (i.e., JSON-LD 1.0) diff --git a/core/vocabulary/src/test/java/org/trellisldp/vocabulary/AbstractVocabularyTest.java b/core/vocabulary/src/test/java/org/trellisldp/vocabulary/AbstractVocabularyTest.java index 177629455..ab58150ac 100644 --- a/core/vocabulary/src/test/java/org/trellisldp/vocabulary/AbstractVocabularyTest.java +++ b/core/vocabulary/src/test/java/org/trellisldp/vocabulary/AbstractVocabularyTest.java @@ -131,7 +131,7 @@ private Stream fields() { .map(name -> name.replaceAll("_", "-")); } - private static class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { + private static final class ReaderRIOTFactoryJSONLD10 implements ReaderRIOTFactory { @Override public ReaderRIOT create(final Lang language, final ParserProfile profile) { // force the use of jsonld-java (i.e., JSON-LD 1.0) diff --git a/core/vocabulary/src/test/resources/logback-test.xml b/core/vocabulary/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/core/vocabulary/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/core/vocabulary/src/test/resources/simplelogger.properties b/core/vocabulary/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/core/vocabulary/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index d8ffc2879..000000000 --- a/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -version = 0.19.1-SNAPSHOT - diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c02..000000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 442d9132e..000000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew deleted file mode 100755 index 4f906e0c8..000000000 --- a/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed 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 -# -# https://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. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index ac1b06f93..000000000 --- a/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/mvnw b/mvnw new file mode 100755 index 000000000..8d937f4c1 --- /dev/null +++ b/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 000000000..f80fbad3e --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/notifications/jackson/build.gradle b/notifications/jackson/build.gradle deleted file mode 100644 index 1359f6f1d..000000000 --- a/notifications/jackson/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Notification Serialization (Jackson)' - -ext { - moduleName = 'org.trellisldp.notification.jackson' - testModules = ['org.apache.commons.rdf.simple'] -} - -dependencies { - api project(':trellis-api') - - implementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion") - - implementation "com.fasterxml.jackson.core:jackson-annotations" - implementation "com.fasterxml.jackson.core:jackson-core" - implementation "com.fasterxml.jackson.core:jackson-databind" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" - implementation project(':trellis-vocabulary') - - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/notifications/jackson/pom.xml b/notifications/jackson/pom.xml new file mode 100644 index 000000000..bdfd063af --- /dev/null +++ b/notifications/jackson/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-notification-jackson + 0.20.0-SNAPSHOT + Trellis Notification Serialization - Jackson + https://www.trellisldp.org + + Trellis LDP Jackson-based notifications + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.apache.commons + commons-rdf-api + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + + + org.apache.commons + commons-rdf-simple + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/notifications/jsonb/build.gradle b/notifications/jsonb/build.gradle deleted file mode 100644 index ed5092784..000000000 --- a/notifications/jsonb/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' - id 'info.solidsoft.pitest' -} - -description = 'Trellis Notification Serialization (jsonb)' - -ext { - moduleName = 'org.trellisldp.notification.jsonb' - testModules = ['org.apache.commons.rdf.simple'] -} - -dependencies { - api project(':trellis-api') - api "jakarta.json.bind:jakarta.json.bind-api:$jsonbApiVersion" - - implementation project(':trellis-vocabulary') - - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" - testImplementation "org.eclipse:yasson:$yassonVersion" - testImplementation "jakarta.json:jakarta.json-api:$jsonApiVersion" -} - -pitest { - pitestVersion = pitestToolVersion - junit5PluginVersion = pitestJunitPluginVersion - threads = 4 -} - diff --git a/notifications/jsonb/pom.xml b/notifications/jsonb/pom.xml new file mode 100644 index 000000000..1b801d0ff --- /dev/null +++ b/notifications/jsonb/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-notification-jsonb + 0.20.0-SNAPSHOT + Trellis Notification Serialization - JsonB + https://www.trellisldp.org + + Trellis LDP JSON-Bind-based notifications + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.apache.commons + commons-rdf-api + + + jakarta.json.bind + jakarta.json.bind-api + + + + + org.apache.commons + commons-rdf-simple + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.eclipse + yasson + test + + + org.slf4j + slf4j-simple + test + + + diff --git a/notifications/pom.xml b/notifications/pom.xml new file mode 100644 index 000000000..9c4c01800 --- /dev/null +++ b/notifications/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../parent + + + org.trellisldp + trellis-notifications-parent + 0.20.0-SNAPSHOT + Trellis Notification parent + https://www.trellisldp.org + + + Trellis LDP server: notification components + + pom + + + jackson + jsonb + reactive + + diff --git a/notifications/reactive/build.gradle b/notifications/reactive/build.gradle deleted file mode 100644 index 8cadedeb6..000000000 --- a/notifications/reactive/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -plugins { - id 'java-library' - id 'biz.aQute.bnd.builder' -} - -description = 'Trellis Notifications (Reactive Messaging)' - -ext { - moduleName = 'org.trellisldp.reactive' - testModules = ['smallrye.config', 'org.trellisldp.vocabulary', 'org.trellisldp.notification.jackson', 'org.apache.commons.rdf.simple'] -} - -dependencies { - api "io.reactivex.rxjava2:rxjava:$rxjavaVersion" - api "jakarta.enterprise:jakarta.enterprise.cdi-api:$cdiApiVersion" - api "jakarta.inject:jakarta.inject-api:$injectApiVersion" - api "org.eclipse.microprofile.reactive.messaging:microprofile-reactive-messaging-api:$microprofileReactiveMessagingVersion" - api project(':trellis-api') - - implementation "org.slf4j:slf4j-api:$slf4jVersion" - - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation "io.smallrye.config:smallrye-config:$smallryeConfigVersion" - testImplementation "io.smallrye.reactive:smallrye-reactive-streams-operators:$smallryeReactiveOperatorsVersion" - testImplementation "io.smallrye.reactive:smallrye-reactive-messaging-provider:$smallryeReactiveVersion" - testImplementation "jakarta.el:jakarta.el-api:$elVersion" - testImplementation "org.apache.commons:commons-rdf-simple:$commonsRdfVersion" - testImplementation("org.awaitility:awaitility:$awaitilityVersion") { - exclude group: "org.hamcrest", module: 'hamcrest-core' - exclude group: 'org.hamcrest', module: 'hamcrest-library' - } - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" - testImplementation("org.jboss.weld:weld-junit5:$weldVersion") { - exclude group: "org.jboss.spec.javax.interceptor", module: "jboss-interceptors-api_1.2_spec" - exclude group: "org.jboss.spec.javax.el", module: "jboss-el-api_3.0_spec" - } - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" - testImplementation project(':trellis-notification-jackson') - testImplementation project(':trellis-vocabulary') -} - -test { - systemProperty 'smallrye-messaging-strict-binding', 'true' - - inputs.property("moduleName", moduleName) - doFirst { - jvmArgs += [ - '--add-opens', "$moduleName/$moduleName=weld.junit5", - '--add-opens', "$moduleName/$moduleName=weld.core.impl", - '--add-opens', 'org.trellisldp.notification.jackson/org.trellisldp.notification.jackson=weld.core.impl', - '--add-opens', 'java.base/java.lang=weld.core.impl', - ] - } -} - diff --git a/notifications/reactive/pom.xml b/notifications/reactive/pom.xml new file mode 100644 index 000000000..f692f0760 --- /dev/null +++ b/notifications/reactive/pom.xml @@ -0,0 +1,145 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-reactive + 0.20.0-SNAPSHOT + Trellis Notifications - Reactive Messaging + https://www.trellisldp.org + + Trellis LDP Reactive messaging module + + jar + + + + org.trellisldp + trellis-api + ${project.version} + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.inject + jakarta.inject-api + + + + + + + io.reactivex.rxjava2 + rxjava + + + io.smallrye.reactive + smallrye-reactive-messaging-api + + + org.eclipse.microprofile.config + microprofile-config-api + + + org.slf4j + slf4j-api + + + + + org.trellisldp + trellis-vocabulary + ${project.version} + test + + + org.trellisldp + trellis-notification-jackson + ${project.version} + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + io.smallrye.config + smallrye-config + test + + + jakarta.el + jakarta.el-api + test + + + org.jboss.weld + weld-junit5 + test + + + org.slf4j + slf4j-simple + test + + + io.smallrye.reactive + smallrye-reactive-streams-operators + test + + + io.smallrye.reactive + smallrye-reactive-messaging-provider + test + + + org.apache.commons + commons-rdf-simple + test + + + org.awaitility + awaitility + test + + + org.hamcrest + hamcrest + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + --add-opens java.base/java.lang=ALL-UNNAMED + + + + + + diff --git a/notifications/reactive/src/main/java/module-info.java b/notifications/reactive/src/main/java/module-info.java index f3c992578..0c6e728e1 100644 --- a/notifications/reactive/src/main/java/module-info.java +++ b/notifications/reactive/src/main/java/module-info.java @@ -18,7 +18,7 @@ requires io.reactivex.rxjava2; requires jakarta.inject; - requires microprofile.reactive.messaging.api; + requires smallrye.reactive.messaging.api; requires org.slf4j; requires org.apache.commons.rdf.api; requires org.trellisldp.api; diff --git a/notifications/reactive/src/test/java/org/trellisldp/reactive/ReactiveNotificationServiceTest.java b/notifications/reactive/src/test/java/org/trellisldp/reactive/ReactiveNotificationServiceTest.java index 6ff485f5a..ff0ebd05d 100644 --- a/notifications/reactive/src/test/java/org/trellisldp/reactive/ReactiveNotificationServiceTest.java +++ b/notifications/reactive/src/test/java/org/trellisldp/reactive/ReactiveNotificationServiceTest.java @@ -25,11 +25,13 @@ import static org.trellisldp.api.TrellisUtils.TRELLIS_DATA_PREFIX; import io.smallrye.config.inject.ConfigProducer; -import io.smallrye.reactive.messaging.MediatorFactory; -import io.smallrye.reactive.messaging.extension.MediatorManager; -import io.smallrye.reactive.messaging.extension.ReactiveMessagingExtension; -import io.smallrye.reactive.messaging.impl.ConfiguredChannelFactory; -import io.smallrye.reactive.messaging.impl.InternalChannelRegistry; +import io.smallrye.reactive.messaging.providers.MediatorFactory; +import io.smallrye.reactive.messaging.providers.connectors.WorkerPoolRegistry; +import io.smallrye.reactive.messaging.providers.extension.HealthCenter; +import io.smallrye.reactive.messaging.providers.extension.MediatorManager; +import io.smallrye.reactive.messaging.providers.extension.ReactiveMessagingExtension; +import io.smallrye.reactive.messaging.providers.impl.InternalChannelRegistry; +import io.smallrye.reactive.messaging.providers.wiring.Wiring; import java.time.Instant; @@ -63,11 +65,13 @@ class ReactiveNotificationServiceTest { .beanClasses( MediatorFactory.class, MediatorManager.class, + HealthCenter.class, InternalChannelRegistry.class, - ConfiguredChannelFactory.class, TestCollector.class, NotificationCollector.class, ReactiveNotificationService.class, + WorkerPoolRegistry.class, + Wiring.class, DefaultNotificationSerializationService.class, ConfigProducer.class) .extensions(new ReactiveMessagingExtension())); diff --git a/notifications/reactive/src/test/resources/logback-test.xml b/notifications/reactive/src/test/resources/logback-test.xml deleted file mode 100644 index aa2e08364..000000000 --- a/notifications/reactive/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/notifications/reactive/src/test/resources/simplelogger.properties b/notifications/reactive/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..6ee34b829 --- /dev/null +++ b/notifications/reactive/src/test/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel=WARN diff --git a/parent/pom.xml b/parent/pom.xml new file mode 100644 index 000000000..f92ab5761 --- /dev/null +++ b/parent/pom.xml @@ -0,0 +1,1018 @@ + + + 4.0.0 + + + org.trellisldp + trellis + 0.20.0-SNAPSHOT + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + Trellis LDP - Parent POM + pom + + + true + 11 + 11 + UTF-8 + UTF-8 + + + 1.16.0 + 2.13.0 + 3.12.0 + 0.5.0 + 1.10.0 + 32.1.2-jre + 2.15.2 + + 1.2.2 + 1.3.5 + 2.0.2 + 3.0.3 + 1.0.1 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + + 3.35.0 + 2.32 + 4.9.0 + 0.9.10 + 2.12.0 + 3.2.1 + 3.5.1 + 3.21.0 + 1.0.13 + 2.0.9 + 2.2.21 + 1.2 + 2.0 + 3.1 + 3.0 + 2.0 + 2.0.1 + 42.4.0 + 1.33 + 2.3.3 + 2.13.0.Final + + + 4.2.0 + 5.10.0 + 2.2 + 4.10.0 + 5.5.0 + 1.17.3 + 1.0.8 + 2.0.2.Final + + + 3.6.0 + 3.3.0 + 3.3.1 + 3.11.0 + 3.6.0 + 3.1.1 + 3.4.1 + 3.1.1 + 3.1.0 + 0.8.10 + 3.3.0 + 3.6.0 + 4.2 + 1.6.13 + 3.4.5 + 3.21.0 + 3.12.1 + 3.0.1 + 3.3.1 + 3.10.0.2594 + 3.3.0 + 3.1.2 + + + 10.12.3 + + + ${maven.multiModuleProjectDirectory}/reports/target/site/jacoco-merged/jacoco.xml + org.trellisldp:trellis + ${project.artifactId} + + + + + Snapshot Repository + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + Staging Repository + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 + + + ${project.artifactId} + ${project.baseUri} + + + + + + + org.apache.commons + commons-rdf-api + ${commons.rdf.version} + + + commons-codec + commons-codec + ${commons.codec.version} + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + jakarta.inject + jakarta.inject-api + ${jakarta.inject.version} + + + jakarta.enterprise + jakarta.enterprise.cdi-api + ${jakarta.cdi.version} + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + jakarta.el + jakarta.el-api + ${jakarta.el.version} + + + org.eclipse.microprofile.config + microprofile-config-api + ${microprofile.config.version} + + + org.eclipse.microprofile.reactive.messaging + microprofile-reactive-messaging-api + ${microprofile.reactive.version} + + + org.eclipse.microprofile.jwt + microprofile-jwt-auth-api + ${microprofile.jwt.version} + + + org.eclipse.microprofile.health + microprofile-health-api + ${microprofile.health.version} + + + org.eclipse.microprofile.openapi + microprofile-openapi-api + ${microprofile.openapi.version} + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + ${microprofile.metrics.version} + + + org.apache.jena + jena-tdb2 + ${jena.version} + + + org.apache.jena + jena-rdfconnection + ${jena.version} + + + org.apache.jena + jena-arq + ${jena.version} + + + org.apache.jena + jena-commonsrdf + ${jena.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + + + com.google.guava + guava + ${guava.version} + + + org.jdbi + jdbi3-core + ${jdbi.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + com.github.spullara.mustache.java + compiler + ${mustache.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + + + org.yaml + snakeyaml + ${snakeyaml.version} + + + org.liquibase + liquibase-core + ${liquibase.version} + + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + io.reactivex.rxjava2 + rxjava + ${rxjava.version} + + + + + org.glassfish.jersey.core + jersey-common + ${jersey.version} + + + org.glassfish.jersey.core + jersey-server + ${jersey.version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} + + + org.glassfish.jersey.connectors + jersey-apache-connector + ${jersey.version} + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + ${jersey.version} + + + io.smallrye.config + smallrye-config + ${smallrye.config.version} + + + io.smallrye + smallrye-health + ${smallrye.health.version} + + + io.smallrye + smallrye-jwt + ${smallrye.jwt.version} + + + io.smallrye + smallrye-jwt-build + ${smallrye.jwt.version} + + + org.postgresql + postgresql + ${postgres.version} + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb.version} + + + org.eclipse + yasson + ${yasson.version} + + + io.smallrye.reactive + smallrye-reactive-messaging-api + ${smallrye.reactive.version} + + + io.smallrye.reactive + smallrye-reactive-streams-operators + ${smallrye.reactive.operators.version} + + + io.smallrye.reactive + smallrye-reactive-messaging-provider + ${smallrye.reactive.version} + + + + + org.junit + junit-bom + ${junit.version} + pom + import + + + org.awaitility + awaitility + ${awaitility.version} + + + org.apache.commons + commons-rdf-simple + ${commons.rdf.version} + + + commons-io + commons-io + ${commons.io.version} + + + org.apache.commons + commons-text + ${commons.text.version} + + + org.mockito + mockito-core + ${mockito.version} + + + org.mockito + mockito-junit-jupiter + ${mockito.version} + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + org.jboss.weld + weld-junit5 + ${weld.version} + + + org.jboss.spec.javax.interceptor + jboss-interceptors-api_1.2_spec + + + org.jboss.spec.javax.el + jboss-el-api_1.2_spec + + + + + org.hamcrest + hamcrest + ${hamcrest.version} + + + org.testcontainers + postgresql + ${testcontainers.version} + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + ${clean.plugin.version} + + + org.apache.maven.plugins + maven-deploy-plugin + ${deploy.plugin.version} + + + org.apache.maven.plugins + maven-assembly-plugin + ${assembly.plugin.version} + + + org.apache.maven.plugins + maven-dependency-plugin + ${dependency.plugin.version} + + + org.apache.maven.plugins + maven-install-plugin + ${install.plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${jar.plugin.version} + + + + true + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + **/generated-sources/** + true + + https://javaee.github.io/javaee-spec/javadocs/ + https://jena.apache.org/documentation/javadoc/jena/ + https://jena.apache.org/documentation/javadoc/arq/ + http://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/ + +
+ Trellis LDP Libraries + ]]> +
+ + + implSpec + a + Implementation Requirements: + + + implNote + a + Implementation Note: + + + apiNote + a + API Note: + + +
+ + + attach-javadocs + + jar + + + + + javadoc + + site + + +
+ + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.plugin.version} + + + enforce + + + + + + + + + enforce + + + + + + org.codehaus.mojo + extra-enforcer-rules + 1.7.0 + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${gpg.plugin.version} + + + sign-artifacts + verify + + sign + + + + + + maven-source-plugin + ${source.plugin.version} + + + attach-sources + + jar-no-fork + + + + + + maven-compiler-plugin + ${compiler.plugin.version} + + + -Xlint:deprecation + -Xlint:unchecked + + + + + maven-surefire-plugin + ${surefire.plugin.version} + + ${surefire.jacoco.args} + + ${maven.home} + + + + + maven-failsafe-plugin + + ${surefire.plugin.version} + + + integration-test + + integration-test + verify + + + + + ${failsafe.jacoco.args} + + ${maven.home} + + + + + org.apache.maven.plugins + maven-release-plugin + ${release.plugin.version} + + true + install + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + + com.mycila + license-maven-plugin + ${license.plugin.version} + + + org.jacoco + jacoco-maven-plugin + ${jacoco.plugin.version} + + + before-unit-test-execution + + prepare-agent + + + surefire.jacoco.args + + + + before-integration-test-execution + pre-integration-test + + prepare-agent-integration + + + failsafe.jacoco.args + + + + merge-unit-and-integration + post-integration-test + + merge + + + + + ${project.build.directory} + + *.exec + + + + ${project.build.directory}/jacoco-merged.exec + + + + create-merged-report + post-integration-test + + report + + + ${project.build.directory}/jacoco-merged.exec + ${project.reporting.outputDirectory}/merged-test-report + + + + report-aggregate-unit + verify + + report-aggregate + + + */jacoco.exec + ${project.reporting.outputDirectory}/jacoco-unit + + + + report-aggregate-integration + verify + + report-aggregate + + + */jacoco-it.exec + ${project.reporting.outputDirectory}/jacoco-integration + + + + report-aggregate + verify + + report-aggregate + + + */jacoco-merged.exec + ${project.reporting.outputDirectory}/jacoco-merged + + + + + + org.apache.maven.plugins + maven-pmd-plugin + ${pmd.plugin.version} + + + org.apache.maven.plugins + maven-resources-plugin + ${resources.plugin.version} + + UTF-8 + UTF-8 + + + + org.apache.maven.plugins + maven-site-plugin + ${site.plugin.version} + + ${project.build.directory}/site + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar.plugin.version} + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.plugin.version} + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + io.quarkus + quarkus-maven-plugin + ${quarkus.version} + + + + generate-code + generate-code-tests + build + + + + +
+
+ + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-site-plugin + + + org.apache.maven.plugins + maven-enforcer-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + + com.puppycrawl.tools + checkstyle + ${checkstyle.tool.version} + + + + true + true + true + true + true + warning + ./buildtools/src/main/resources/checkstyle/checkstyle.xml + ./buildtools/src/main/resources/checkstyle/suppressions.xml + ${project.build.sourceDirectory} + + + + checkstyle + verify + + check + + + + + + org.apache.maven.plugins + maven-pmd-plugin + + false + false + true + + ./buildtools/src/main/resources/pmd/pmd.xml + + + target/generated-sources + + + + + + check + + + + + + com.mycila + license-maven-plugin + +
./buildtools/src/main/resources/license/HEADER.txt
+ + SLASHSTAR_STYLE + + + **/src/main/resources/** + **/src/test/resources/** + + + **/src/main/java/** + **/src/test/java/** + +
+ + + + check + + + +
+
+
+ + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${projectinfo.plugin.version} + + false + + + + Apache 2.0 + Apache-2.0 + Apache Software License - Version 2.0 + The Apache License, Version 2.0 + The Apache Software License, Version 2.0 + + Apache License, Version 2.0 + + + + MIT + The MIT License + + MIT License + + + + The BSD 3-Clause License + BSD-3-Clause + BSD License 3 + + BSD 3-Clause License + + + + Eclipse Public License - Version 1.0 + + Eclipse Public License 1.0 + + + + Eclipse Public License v2.0 + + Eclipse Public License 2.0 + + + + EDL 1.0 + Eclipse Distribution License - v 1.0 + Eclipse Distribution License v1.0 + + Eclipse Distribution License 1.0 + + + + Eclipse Public License v2.0 + + Eclipse Public License 2.0 + + + + + + + index + dependencies + summary + plugins + licenses + modules + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + + default + + javadoc + + + + aggregate + false + + aggregate + + + + + + + + + + + + + + acoburn + Aaron Coburn + + + + + + Apache License, Version 2.0 + + + + + Trellis LDP + https://www.trellisldp.org + + + + scm:git:https://github.com/trellis-ldp/trellis.git + scm:git:git@github.com:trellis-ldp/trellis.git + https://github.com/trellis-ldp/trellis + HEAD + +
diff --git a/platform/bom/build.gradle b/platform/bom/build.gradle deleted file mode 100644 index 793efa920..000000000 --- a/platform/bom/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ - -dependencies { - implementation project(':trellis-api') - implementation project(':trellis-common') - implementation project(':trellis-http') - implementation project(':trellis-vocabulary') - - implementation project(':trellis-notification-jackson') - implementation project(':trellis-notification-jsonb') - implementation project(':trellis-reactive') - - implementation project(':trellis-jwt') - implementation project(':trellis-webac') - - implementation project(':trellis-app') - implementation project(':trellis-audit') - implementation project(':trellis-cache') - implementation project(':trellis-cdi') - implementation project(':trellis-constraint') - implementation project(':trellis-file') - implementation project(':trellis-jdbc') - implementation project(':trellis-jena') - implementation project(':trellis-namespace') - implementation project(':trellis-rdfa') - implementation project(':trellis-test') - implementation project(':trellis-triplestore') - implementation project(':trellis-webdav') -} - -publishing { - publications { - maven(MavenPublication) { - pom { - packaging = 'pom' - } - pom.withXml { - // eliminate test-scoped dependencies - asNode().dependencies.removeAll { dep -> dep.scope == "test" } - // copy the dependencies node under dependencyManagement - def dependencies = new Node(new Node(asNode(), 'dependencyManagement'), 'dependencies') - asNode().dependencies.dependency.forEach { dep -> new Node(dependencies, 'dependency', dep.value()) } - dependencies.dependency.forEach { dep -> dep.remove(dep.scope) } - // remove the dependencies node - asNode().remove(asNode().dependencies) - } - artifacts = [] - } - } -} - -tasks.withType(GenerateModuleMetadata) { - enabled = false -} - diff --git a/platform/bom/pom.xml b/platform/bom/pom.xml new file mode 100644 index 000000000..1fce1ae8c --- /dev/null +++ b/platform/bom/pom.xml @@ -0,0 +1,134 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-bom + 0.20.0-SNAPSHOT + Trellis BOM + https://www.trellisldp.org + + Trellis LDP BOM + + pom + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-http + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.trellisldp + trellis-notification-jackson + ${project.version} + + + org.trellisldp + trellis-notification-jsonb + ${project.version} + + + org.trellisldp + trellis-reactive + ${project.version} + + + org.trellisldp + trellis-jwt + ${project.version} + + + org.trellisldp + trellis-webac + ${project.version} + + + org.trellisldp + trellis-app + ${project.version} + + + org.trellisldp + trellis-audit + ${project.version} + + + org.trellisldp + trellis-cache + ${project.version} + + + org.trellisldp + trellis-cdi + ${project.version} + + + org.trellisldp + trellis-constraint + ${project.version} + + + org.trellisldp + trellis-file + ${project.version} + + + org.trellisldp + trellis-jdbc + ${project.version} + + + org.trellisldp + trellis-jena + ${project.version} + + + org.trellisldp + trellis-namespace + ${project.version} + + + org.trellisldp + trellis-rdfa + ${project.version} + + + org.trellisldp + trellis-test + ${project.version} + + + org.trellisldp + trellis-triplestore + ${project.version} + + + org.trellisldp + trellis-webdav + ${project.version} + + + diff --git a/platform/openliberty/build.gradle b/platform/openliberty/build.gradle deleted file mode 100644 index 796a63df2..000000000 --- a/platform/openliberty/build.gradle +++ /dev/null @@ -1,113 +0,0 @@ -// OpenLiberty requires using the legacy plugin management mechanism -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'io.openliberty.tools:liberty-gradle-plugin:3.5' - } -} - -plugins { - id "war" -} - -apply plugin: 'liberty' - -ext { - appName = "trellis" - testServerHttpPort = 9080 - testServerHttpsPort = 9443 - warContext = appName -} - -dependencies { - implementation platform("org.eclipse.microprofile:microprofile:$microprofileVersion") - - implementation "jakarta.enterprise:jakarta.enterprise.cdi-api:${cdiApiVersion}" - implementation "jakarta.annotation:jakarta.annotation-api:$annotationApiVersion" - implementation "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsApiVersion" - - implementation project(':trellis-api') - implementation project(':trellis-app') - implementation project(':trellis-audit') - implementation project(':trellis-cdi') - implementation project(':trellis-constraint') - implementation project(':trellis-file') - implementation project(':trellis-http') - implementation project(':trellis-jena') - implementation project(':trellis-namespace') - implementation project(':trellis-notification-jsonb') - implementation project(':trellis-rdfa') - implementation project(':trellis-triplestore') - implementation project(':trellis-vocabulary') - implementation project(':trellis-webac') - - implementation("com.github.jsonld-java:jsonld-java:$jsonldVersion") { - exclude group: 'org.apache.httpcomponents', module: 'httpclient-osgi' - exclude group: 'org.apache.httpcomponents', module: 'httpcore-osgi' - } - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.apache.jena:jena-rdfconnection:$jenaVersion" - implementation "org.apache.jena:jena-tdb2:$jenaVersion" - implementation "org.eclipse.microprofile.config:microprofile-config-api" - implementation "org.slf4j:slf4j-api:$slf4jVersion" - implementation "org.apache.commons:commons-rdf-api:$commonsRdfVersion" - implementation "org.apache.jena:jena-commonsrdf:$jenaVersion" - - runtimeOnly "ch.qos.logback:logback-classic:$logbackVersion" - runtimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - runtimeOnly "jakarta.validation:jakarta.validation-api:$validationApiVersion" - runtimeOnly "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - - testImplementation project(':trellis-test') - - testImplementation("io.smallrye.config:smallrye-config:$smallryeConfigVersion") - testImplementation("org.apache.cxf:cxf-rt-rs-client:$cxfVersion") - testImplementation("org.awaitility:awaitility:$awaitilityVersion") { - exclude group: "org.hamcrest", module: 'hamcrest-core' - exclude group: 'org.hamcrest', module: 'hamcrest-library' - } - testImplementation("org.hamcrest:hamcrest:$hamcrestVersion") - testImplementation("org.mockito:mockito-core:$mockitoVersion") - - libertyRuntime group:'io.openliberty', name:'openliberty-runtime', version:'[19.0.0.12,)' -} - -liberty { - server { - name = "${appName}" - serverXmlFile = file("src/main/liberty/config/server.xml") - bootstrapProperties = ['default.http.port': testServerHttpPort, - 'default.https.port': testServerHttpsPort, - 'trellis.triplestore.rdf-location': 'data/resources', - 'trellis.file.memento-path': 'data/mementos', - 'trellis.file.namespace-path': 'data/namespaces', - 'trellis.file.binary-path': 'data/binary', - 'app.context.root': warContext] - packageLiberty { - include = "usr" - } - } -} - -war { - archiveFileName.set(archiveBaseName.flatMap { base -> archiveExtension.map { ext -> base + "." + ext} }) -} - -test { - systemProperties = [ - 'liberty.test.port': testServerHttpPort, - 'war.name': warContext - ] -} - -test.dependsOn 'libertyStart' -test.finalizedBy 'libertyStop' -libertyPackage.dependsOn 'libertyStop' - -sonarqube { - skipProject = true -} - diff --git a/platform/openliberty/pom.xml b/platform/openliberty/pom.xml new file mode 100644 index 000000000..9d5a446ca --- /dev/null +++ b/platform/openliberty/pom.xml @@ -0,0 +1,249 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-openliberty + 0.20.0-SNAPSHOT + Trellis Open Liberty App + https://www.trellisldp.org + + Trellis LDP Open Liberty Application + + war + + + 3.5.4 + 23.0.0.5 + + + + + + org.junit + junit-bom + ${junit.version} + pom + import + + + + io.quarkus + quarkus-bom + ${quarkus.version} + pom + import + + + + + + + jakarta.platform + jakarta.jakartaee-api + 8.0.0 + provided + + + org.eclipse.microprofile + microprofile + 4.1 + pom + provided + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-http + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + org.trellisldp + trellis-notification-jsonb + ${project.version} + + + org.trellisldp + trellis-jwt + ${project.version} + + + org.trellisldp + trellis-webac + ${project.version} + + + org.trellisldp + trellis-app + ${project.version} + + + org.trellisldp + trellis-audit + ${project.version} + + + org.trellisldp + trellis-cache + ${project.version} + + + org.trellisldp + trellis-cdi + ${project.version} + + + org.trellisldp + trellis-constraint + ${project.version} + + + org.trellisldp + trellis-file + ${project.version} + + + org.trellisldp + trellis-jena + ${project.version} + + + org.trellisldp + trellis-namespace + ${project.version} + + + org.trellisldp + trellis-rdfa + ${project.version} + + + org.trellisldp + trellis-triplestore + ${project.version} + + + + + org.trellisldp + trellis-test + ${project.version} + test + + + org.apache.cxf + cxf-rt-rs-client + ${cxf.version} + test + + + io.rest-assured + rest-assured + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + io.smallrye.config + smallrye-config + test + + + + + trellis-openliberty + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + ${project.build.directory}/liberty/wlp/usr/servers/trellis/apps/ + + + + + io.openliberty.tools + liberty-maven-plugin + 3.8.2 + + + start-liberty + pre-integration-test + + stop + start + + + src/main/liberty/config/server.xml + + 9080 + 9443 + data/resources + data/mementos + data/namespaces + data/binary + trellis + + + + + stop-liberty + post-integration-test + + stop + + + + + trellis + + io.openliberty + openliberty-microProfile4 + ${openliberty.version} + zip + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + --add-opens java.base/java.net=ALL-UNNAMED + + + + + + diff --git a/platform/openliberty/src/main/liberty/config/server.xml b/platform/openliberty/src/main/liberty/config/server.xml index a009f3051..590ab1f31 100644 --- a/platform/openliberty/src/main/liberty/config/server.xml +++ b/platform/openliberty/src/main/liberty/config/server.xml @@ -4,10 +4,15 @@ microProfile-4.0 + + + + + - + diff --git a/platform/openliberty/src/main/resources/logback.xml b/platform/openliberty/src/main/resources/logback.xml deleted file mode 100644 index aa2e08364..000000000 --- a/platform/openliberty/src/main/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - %p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n - - - - - - - - - - diff --git a/platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationTest.java b/platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationIT.java similarity index 70% rename from platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationTest.java rename to platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationIT.java index ae15e5254..0c0197d39 100644 --- a/platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationTest.java +++ b/platform/openliberty/src/test/java/org/trellisldp/openliberty/TrellisApplicationIT.java @@ -25,13 +25,12 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.TestInstance; import org.trellisldp.test.AbstractApplicationLdpTests; -import org.trellisldp.test.AbstractApplicationMementoTests; @TestInstance(PER_CLASS) -class TrellisApplicationTest { +class TrellisApplicationIT { private final Client CLIENT = newBuilder().build(); - private final String TRELLIS_URL = "http://localhost:" + getInteger("trellis.port", 9080) + "/"; + private final String TRELLIS_URL = "http://localhost:" + getInteger("trellis.port", 9080) + "/trellis/"; @Nested @DisplayName("Trellis LDP Tests") @@ -39,27 +38,12 @@ class LdpTests extends AbstractApplicationLdpTests { @Override public Client getClient() { - return TrellisApplicationTest.this.CLIENT; + return TrellisApplicationIT.this.CLIENT; } @Override public String getBaseURL() { - return TrellisApplicationTest.this.TRELLIS_URL; - } - } - - @Nested - @DisplayName("Trellis Memento Tests") - class MementoTests extends AbstractApplicationMementoTests { - - @Override - public Client getClient() { - return TrellisApplicationTest.this.CLIENT; - } - - @Override - public String getBaseURL() { - return TrellisApplicationTest.this.TRELLIS_URL; + return TrellisApplicationIT.this.TRELLIS_URL; } } } diff --git a/platform/pom.xml b/platform/pom.xml new file mode 100644 index 000000000..09b1b7af6 --- /dev/null +++ b/platform/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../parent + + + org.trellisldp + trellis-platform-parent + 0.20.0-SNAPSHOT + Trellis Platform parent + https://www.trellisldp.org + + + Trellis LDP server: platform parent + + pom + + + bom + quarkus + openliberty + + diff --git a/platform/quarkus/build.gradle b/platform/quarkus/build.gradle deleted file mode 100644 index 086a989b8..000000000 --- a/platform/quarkus/build.gradle +++ /dev/null @@ -1,85 +0,0 @@ -plugins { - id 'io.quarkus' version "$quarkusVersion" -} - -dependencies { - implementation platform("io.quarkus:quarkus-bom:$quarkusVersion") - - implementation 'io.quarkus:quarkus-jsonb' - implementation 'io.quarkus:quarkus-resteasy' - implementation 'io.quarkus:quarkus-security' - implementation 'io.quarkus:quarkus-smallrye-health' - implementation 'io.quarkus:quarkus-smallrye-jwt' - implementation 'io.quarkus:quarkus-smallrye-metrics' - implementation 'io.quarkus:quarkus-smallrye-openapi' - implementation 'io.quarkus:quarkus-smallrye-reactive-messaging' - - implementation "com.github.jsonld-java:jsonld-java:$jsonldVersion" - implementation "com.github.spullara.mustache.java:compiler:$mustacheVersion" - implementation "com.google.guava:guava:$guavaVersion" - implementation "commons-codec:commons-codec:$commonsCodecVersion" - implementation "org.apache.jena:jena-arq:$jenaVersion" - implementation "org.apache.jena:jena-rdfconnection:$jenaVersion" - implementation "org.apache.jena:jena-tdb2:$jenaVersion" - - implementation project(":trellis-api") - implementation project(":trellis-app") - implementation project(":trellis-audit") - implementation project(":trellis-cache") - implementation project(":trellis-cdi") - implementation project(":trellis-constraint") - implementation project(":trellis-file") - implementation project(":trellis-http") - implementation project(":trellis-jena") - implementation project(":trellis-jwt") - implementation project(":trellis-namespace") - implementation project(":trellis-notification-jsonb") - implementation project(":trellis-rdfa") - implementation project(":trellis-reactive") - implementation project(":trellis-vocabulary") - implementation project(":trellis-webac") - - // Persistence store - if (project.hasProperty("triplestore")) { - implementation project(":trellis-triplestore") - } else { - implementation 'io.quarkus:quarkus-agroal' - implementation 'io.quarkus:quarkus-flyway' - implementation 'io.quarkus:quarkus-jdbc-postgresql' - implementation project(":trellis-jdbc") - - runtimeOnly "org.yaml:snakeyaml:$snakeyamlVersion" - } - - runtimeOnly "jakarta.activation:jakarta.activation-api:$activationApiVersion" - runtimeOnly "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion" - runtimeOnly "org.postgresql:postgresql:$postgresVersion" - - testImplementation project(":trellis-test") - testImplementation "io.quarkus:quarkus-junit5" - testImplementation "io.rest-assured:rest-assured" - testImplementation "org.jboss.resteasy:resteasy-client" -} - -test { - systemProperty 'com.arjuna.ats.arjuna.objectstore.objectStoreDir', "$buildDir/data/ObjectStore" - systemProperty 'trellis.file.binary-path', "$buildDir/data/binaries" - systemProperty 'trellis.file.memento-path', "$buildDir/data/mementos" - systemProperty 'trellis.namespace.mapping', 'dc11=http://purl.org/dc/elements/1.1/,,foo= , =bar,baz, = ' - systemProperty 'mp.jwt.verify.publickey.location', 'https://www.trellisldp.org/tests/jwks.json' - - if (project.hasProperty("triplestore")) { - systemProperty 'trellis.triplestore.rdf-location', "$buildDir/data/rdf" - } else { - systemProperty 'com.arjuna.ats.arjuna.objectstore.objectStoreDir', "$buildDir/data/ObjectStore" - systemProperty 'quarkus.datasource.jdbc.url', 'jdbc:postgresql://localhost/postgres' - systemProperty 'quarkus.flyway.migrate-at-start', 'true' - } -} - -sonarqube { - skipProject = true -} - -buildNative.enabled = false - diff --git a/platform/quarkus/pom.xml b/platform/quarkus/pom.xml new file mode 100644 index 000000000..57514783b --- /dev/null +++ b/platform/quarkus/pom.xml @@ -0,0 +1,225 @@ + + + 4.0.0 + + + org.trellisldp + trellis-parent + 0.20.0-SNAPSHOT + ../../parent + + + org.trellisldp + trellis-quarkus + 0.20.0-SNAPSHOT + Trellis Quarkus App + https://www.trellisldp.org + + Trellis LDP Quarkus Application + + jar + + + + + org.junit + junit-bom + ${junit.version} + pom + import + + + + io.quarkus + quarkus-bom + ${quarkus.version} + pom + import + + + + + + + io.quarkus + quarkus-jsonb + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-security + + + io.quarkus + quarkus-smallrye-health + + + io.quarkus + quarkus-smallrye-jwt + + + io.quarkus + quarkus-smallrye-metrics + + + io.quarkus + quarkus-smallrye-openapi + + + io.quarkus + quarkus-smallrye-reactive-messaging + + + + org.trellisldp + trellis-api + ${project.version} + + + org.trellisldp + trellis-common + ${project.version} + + + org.trellisldp + trellis-http + ${project.version} + + + org.trellisldp + trellis-vocabulary + ${project.version} + + + + org.trellisldp + trellis-notification-jsonb + ${project.version} + + + org.trellisldp + trellis-reactive + ${project.version} + + + + org.trellisldp + trellis-jwt + ${project.version} + + + org.trellisldp + trellis-webac + ${project.version} + + + + org.trellisldp + trellis-app + ${project.version} + + + org.trellisldp + trellis-audit + ${project.version} + + + org.trellisldp + trellis-cache + ${project.version} + + + org.trellisldp + trellis-cdi + ${project.version} + + + org.trellisldp + trellis-constraint + ${project.version} + + + org.trellisldp + trellis-file + ${project.version} + + + org.trellisldp + trellis-jena + ${project.version} + + + org.trellisldp + trellis-namespace + ${project.version} + + + org.trellisldp + trellis-rdfa + ${project.version} + + + org.trellisldp + trellis-triplestore + ${project.version} + + + + + org.trellisldp + trellis-test + ${project.version} + test + + + io.quarkus + quarkus-junit5 + test + + + org.jboss.resteasy + resteasy-client + test + + + io.rest-assured + rest-assured + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.slf4j + slf4j-simple + test + + + + + + + io.quarkus + quarkus-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${project.build.directory} + ${project.build.directory}/data/binaries + ${project.build.directory}/data/mementos + https://www.trellisldp.org/tests/jwks.json + ${project.build.directory}/data/rdf + + + + + + diff --git a/platform/quarkus/src/main/docker/Dockerfile.jvm b/platform/quarkus/src/main/docker/Dockerfile.jvm index 0371a202a..356eedf02 100644 --- a/platform/quarkus/src/main/docker/Dockerfile.jvm +++ b/platform/quarkus/src/main/docker/Dockerfile.jvm @@ -3,7 +3,7 @@ # # Before building the docker image run: # -# ./gradlew assemble +# ./mvnw package # # Then, build the image with: # @@ -14,15 +14,15 @@ # docker run -i --rm -p 8080:8080 trellisldp/trellis- # ### -FROM openjdk:11-jre-slim +FROM eclipse-temurin:17-jre-alpine LABEL maintainer="Aaron Coburn " ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -Dcom.github.jsonldjava.disallowRemoteContextLoading=true" -COPY build/quarkus-app/lib/ /trellis/lib/ -COPY build/quarkus-app/app/ /trellis/app/ -COPY build/quarkus-app/quarkus/ /trellis/quarkus/ -COPY build/quarkus-app/quarkus-run.jar /trellis/app.jar +COPY target/quarkus-app/lib/ /trellis/lib/ +COPY target/quarkus-app/app/ /trellis/app/ +COPY target/quarkus-app/quarkus/ /trellis/quarkus/ +COPY target/quarkus-app/quarkus-run.jar /trellis/app.jar WORKDIR /trellis/ diff --git a/platform/quarkus/src/main/resources/application.properties b/platform/quarkus/src/main/resources/application.properties index 9f963cf76..9d0da4d98 100644 --- a/platform/quarkus/src/main/resources/application.properties +++ b/platform/quarkus/src/main/resources/application.properties @@ -2,10 +2,6 @@ trellis.triplestore.ldp-type=true trellis.triplestore.rdf-location=data/rdf -# Trellis JDBC -trellis.jdbc.batch-size=1000 -trellis.jdbc.ldp-type=true - # Trellis Auth trellis.auth.realm=trellis trellis.auth.admin-users= @@ -63,15 +59,6 @@ quarkus.http.cors.access-control-max-age=24H # HTTP quarkus.http.port=8080 -# Datasource -quarkus.datasource.db-kind=postgresql -quarkus.datasource.username=trellis -quarkus.datasource.password=changeme -quarkus.datasource.jdbc.url= -quarkus.datasource.jdbc.min-size=3 -quarkus.datasource.jdbc.max-size=20 -quarkus.flyway.migrate-at-start=true - # JWT mp.jwt.verify.issuer=NONE mp.jwt.verify.publickey=NONE diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..994c2b696 --- /dev/null +++ b/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.trellisldp + trellis + 0.20.0-SNAPSHOT + Trellis LDP + https://www.trellisldp.org + + + Trellis LDP server + + pom + + + auth + core + components + notifications + platform + + diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 223616e4a..000000000 --- a/settings.gradle +++ /dev/null @@ -1,77 +0,0 @@ -pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - } - plugins { - id 'biz.aQute.bnd.builder' version "6.3.1" - id 'info.solidsoft.pitest' version "1.9.0" - } -} - -plugins { - id "com.gradle.enterprise" version "3.11.1" -} - -rootProject.name = 'trellis' - -include ':trellis-api' -include ':trellis-http' -include ':trellis-common' -include ':trellis-vocabulary' - -include ':trellis-notification-jackson' -include ':trellis-notification-jsonb' -include ':trellis-reactive' - -include ':trellis-jwt' -include ':trellis-webac' - -include ':trellis-app' -include ':trellis-audit' -include ':trellis-cache' -include ':trellis-cdi' -include ':trellis-constraint' -include ':trellis-file' -include ':trellis-jena' -include ':trellis-jdbc' -include ':trellis-namespace' -include ':trellis-rdfa' -include ':trellis-triplestore' -include ':trellis-webdav' - -include ':trellis-bom' -include ':trellis-openliberty' -include ':trellis-quarkus' -include ':trellis-test' - -project(':trellis-api').projectDir = new File(rootDir, "core/api") -project(':trellis-http').projectDir = new File(rootDir, "core/http") -project(':trellis-common').projectDir = new File(rootDir, "core/common") -project(':trellis-vocabulary').projectDir = new File(rootDir, "core/vocabulary") - -project(':trellis-notification-jackson').projectDir = new File(rootDir, "notifications/jackson") -project(':trellis-notification-jsonb').projectDir = new File(rootDir, "notifications/jsonb") -project(':trellis-reactive').projectDir = new File(rootDir, "notifications/reactive") - -project(':trellis-jwt').projectDir = new File(rootDir, "auth/jwt") -project(':trellis-webac').projectDir = new File(rootDir, "auth/webac") - -project(':trellis-app').projectDir = new File(rootDir, "components/app") -project(':trellis-audit').projectDir = new File(rootDir, "components/audit") -project(':trellis-cache').projectDir = new File(rootDir, "components/cache") -project(':trellis-cdi').projectDir = new File(rootDir, "components/cdi") -project(':trellis-constraint').projectDir = new File(rootDir, "components/constraint") -project(':trellis-file').projectDir = new File(rootDir, "components/file") -project(':trellis-jena').projectDir = new File(rootDir, "components/jena") -project(':trellis-jdbc').projectDir = new File(rootDir, "components/jdbc") -project(':trellis-namespace').projectDir = new File(rootDir, "components/namespace") -project(':trellis-rdfa').projectDir = new File(rootDir, "components/rdfa") -project(':trellis-test').projectDir = new File(rootDir, "components/test") -project(':trellis-triplestore').projectDir = new File(rootDir, "components/triplestore") -project(':trellis-webdav').projectDir = new File(rootDir, "components/webdav") - -project(':trellis-bom').projectDir = new File(rootDir, "platform/bom") -project(':trellis-openliberty').projectDir = new File(rootDir, "platform/openliberty") -project(':trellis-quarkus').projectDir = new File(rootDir, "platform/quarkus") -