diff --git a/.github/workflows/arq-glassfish-managed.yml b/.github/workflows/arq-glassfish-managed.yml new file mode 100644 index 000000000..0a86cfd39 --- /dev/null +++ b/.github/workflows/arq-glassfish-managed.yml @@ -0,0 +1,33 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: arq-glassfish-managed + +on: + push: + paths-ignore: + - "docs/**" + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'zulu' + cache: maven + - name: Build with Maven + run: | + mvn -B -q clean verify -Parq-glassfish-managed + + diff --git a/.github/workflows/arq-glassfish-remote.yml b/.github/workflows/arq-glassfish-remote.yml new file mode 100644 index 000000000..8c5086cfb --- /dev/null +++ b/.github/workflows/arq-glassfish-remote.yml @@ -0,0 +1,59 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: arq-glassfish-remote + +on: + push: + paths-ignore: + - "docs/**" + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'zulu' + cache: maven + - name: Run Glassfish Server + run: | + export GLASSFISH_ARCHIVE=glassfish7 + export GLASSFISH_VERSION=7.0.9 + export INSTALL_DIR="/opt/appsvr" + mkdir ${INSTALL_DIR} + + curl -o /tmp/${GLASSFISH_ARCHIVE}.zip -L https://github.com/eclipse-ee4j/glassfish/releases/download/${GLASSFISH_VERSION}/glassfish-${GLASSFISH_VERSION}.zip \ + && unzip /tmp/${GLASSFISH_ARCHIVE}.zip -d ${INSTALL_DIR} \ + && rm /tmp/${GLASSFISH_ARCHIVE}.zip \ + && true + + chmod -R a+rw ${INSTALL_DIR} + chmod -R a+x ${INSTALL_DIR}/${GLASSFISH_ARCHIVE}/bin/* + export PATH=$PATH:${INSTALL_DIR}/${GLASSFISH_ARCHIVE}/bin/ + asadmin start-database \ + && asadmin start-domain domain1 \ + && true + # echo "set AS_ADMIN_PASSWORD=adminadmin" \ + # && echo "AS_ADMIN_PASSWORD=\nAS_ADMIN_NEWPASSWORD=adminadmin" > /tmp/new_passwordfile \ + # && echo "AS_ADMIN_PASSWORD=adminadmin" > /tmp/passwordfile \ + # && cat /tmp/new_passwordfile && cat /tmp/passwordfile \ + # && asadmin --passwordfile /tmp/new_passwordfile change-admin-password --domain_name domain1 \ + # && asadmin --passwordfile /tmp/passwordfile start-domain domain1 \ + # && true + # + - name: Build with Maven + run: | + mvn -B -q clean verify -Parq-glassfish-remote + + \ No newline at end of file diff --git a/.github/workflows/arq-wildfly-managed.yml b/.github/workflows/arq-wildfly-managed.yml new file mode 100644 index 000000000..25160c051 --- /dev/null +++ b/.github/workflows/arq-wildfly-managed.yml @@ -0,0 +1,28 @@ +name: arq-wildfly-managed + +on: + push: + paths-ignore: + - "docs/**" + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '21' + cache: "maven" + - name: Run integration test with -Parq-wildfly-managed + run: mvn clean verify -Parq-wildfly-managed diff --git a/.github/workflows/arq-wildfly-remote.yml b/.github/workflows/arq-wildfly-remote.yml new file mode 100644 index 000000000..8452e714b --- /dev/null +++ b/.github/workflows/arq-wildfly-remote.yml @@ -0,0 +1,47 @@ +name: arq-wildfly-remote + +on: + push: + paths-ignore: + - "docs/**" + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDKs + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '21' + cache: "maven" + - name: Run WildFly server + run: | + export WF_ARCHIVE=wildfly + export WF_VERSION=30.0.0.Final + export INSTALL_DIR="/opt/appsvr" + mkdir ${INSTALL_DIR} + + curl -o /tmp/${WF_ARCHIVE}.zip -L https://github.com/wildfly/wildfly/releases/download/${WF_VERSION}/wildfly-${WF_VERSION}.zip \ + && unzip /tmp/${WF_ARCHIVE}.zip -d ${INSTALL_DIR} \ + && rm /tmp/${WF_ARCHIVE}.zip \ + && true + + chmod -R a+rw ${INSTALL_DIR} + chmod -R a+x ${INSTALL_DIR}/${WF_ARCHIVE}-${WF_VERSION}/bin/* + export WF_HOME=${INSTALL_DIR}/${WF_ARCHIVE}-${WF_VERSION} + ${WF_HOME}/bin/add-user.sh admin Admin@123 --silent + ${WF_HOME}/bin/standalone.sh -c standalone-full.xml & + sleep 10 + + - name: Build with Maven + run: mvn clean verify -Parq-wildfly-remote diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e535b13a..c5bda1b71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: "11" + java-version: "21" - uses: axel-op/googlejavaformat-action@v3 with: args: "--aosp --skip-reflowing-long-strings --skip-sorting-imports --replace" @@ -38,18 +38,13 @@ jobs: build: runs-on: ubuntu-latest needs: [ formatting ] - strategy: - matrix: - distribution: ['temurin', 'zulu'] - # test against latest update of each major Java version, as well as specific updates of LTS versions: - java: [ 11, 17 ] steps: - uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v3 with: - distribution: ${{matrix.distribution}} - java-version: ${{matrix.java}} + distribution: 'zulu' + java-version: '21' cache: 'maven' - name: Build with Maven run: mvn clean package --file pom.xml diff --git a/.github/workflows/it-with-arq-payara-managed.yml b/.github/workflows/it-with-arq-payara-managed.yml deleted file mode 100644 index 32e7a4855..000000000 --- a/.github/workflows/it-with-arq-payara-managed.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: it-with-arq-payara-managed - -on: - push: - paths-ignore: - - "docs/**" - branches: - - master - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - it-with-arq-payara-managed: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - # - uses: AdoptOpenJDK/install-jdk@v1 - # with: - # version: '11' - # architecture: x64 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '11' - cache: 'maven' - - # Use custom JDK file. - # - run: | - # download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz" - # wget -O $RUNNER_TEMP/java_package.tar.gz $download_url - # - uses: actions/setup-java@v3 - # with: - # distribution: 'jdkfile' - # jdkFile: ${{ runner.temp }}/java_package.tar.gz - # java-version: '11.0.0' - # architecture: x64 - # Install Zulu JDK via SDKMAN: - # - run: | - # curl -s "https://get.sdkman.io" | bash - # source "$HOME/.sdkman/bin/sdkman-init.sh" - # # Install Java 11: - # sdk install java `sdk list java | grep -E "11.[0-9]*.[0-9]*-zulu" | head -1 | awk '{print $NF}'` - # # Set JAVA_HOME: - # export JAVA_HOME=$HOME/.sdkman/candidates/java/current - - - name: Start up databases via Docker Compose - run: | - docker-compose up -d postgres - docker ps -a - - name: Run integration test with -Parq-payara-managed - run: mvn clean verify -Parq-payara-managed -# - name: Run integration test with -Parq-payara-managed -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# run: | -# mvn clean verify -Parq-payara-managed,coverage jacoco:report \ -# org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -# -Dsonar.host.url=https://sonarcloud.io \ -# -Dsonar.login=$SONAR_TOKEN \ -# -Dsonar.organization=hantsy \ -# -Dsonar.projectKey=hantsy_cargotracker \ -# -Dsonar.coverage.exclusions=**/dto/* diff --git a/.github/workflows/it-with-arq-wildfly-managed.yml b/.github/workflows/it-with-arq-wildfly-managed.yml deleted file mode 100644 index d7b56f988..000000000 --- a/.github/workflows/it-with-arq-wildfly-managed.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: it-with-arq-wildfly-managed - -on: - push: - paths-ignore: - - "docs/**" - branches: - - master - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - it-with-arq-wildfly-managed: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '11' - cache: 'maven' - - - name: Start up databases via Docker Compose - run: | - docker-compose up -d postgres - docker ps -a - - name: Cache SonarCloud packages - uses: actions/cache@v3.3.2 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Run integration test with -Parq-wildfly-managed - run: mvn clean verify -Parq-wildfly-managed,wildfly diff --git a/.gitignore b/.gitignore index 3a07c7b50..ec7415cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ nb* data cargo-tracker-data/ .factorypath +installs/ diff --git a/README.md b/README.md index 793714df7..9cbd71b82 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,38 @@ # Eclipse Cargo Tracker - Applied Domain-Driven Design Blueprints for Jakarta EE ![compile and build](https://github.com/hantsy/cargotracker/workflows/build/badge.svg) -![Integration Test with Arquillian Payara Managed Container](https://github.com/hantsy/cargotracker/workflows/it-with-arq-payara-managed/badge.svg) -![Integration Test with Arquillian WildFly Managed Container](https://github.com/hantsy/cargotracker/workflows/it-with-arq-wildfly-managed/badge.svg) +![Integration Test with Arquillian GlassFish Managed Container](https://github.com/hantsy/cargotracker/workflows/arq-glassfish-managed/badge.svg) +![Integration Test with Arquillian GlassFish Remote Container](https://github.com/hantsy/cargotracker/workflows/arq-glassfish-remote/badge.svg) +![Integration Test with Arquillian WildFly Managed Container](https://github.com/hantsy/cargotracker/workflows/arq-wildfly-managed/badge.svg) +![Integration Test with Arquillian WildFly Remote Container](https://github.com/hantsy/cargotracker/workflows/arq-wildfly-remote/badge.svg) + [![CircleCI](https://circleci.com/gh/hantsy/cargotracker.svg?style=svg)](https://circleci.com/gh/hantsy/cargotracker) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=hantsy_cargotracker&metric=alert_status)](https://sonarcloud.io/dashboard?id=hantsy_cargotracker) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=hantsy_cargotracker&metric=coverage)](https://sonarcloud.io/dashboard?id=hantsy_cargotracker) - > **This is a personal fork of [Eclipse EE4J CargoTracker](https://github.com/eclipse-ee4j/cargotracker), I'm also [a contributor of the CargoTracker project](https://github.com/eclipse-ee4j/cargotracker/graphs/contributors).** > For the detailed introduction to the CargoTracker project, go to the upstream project website: https://eclipse-ee4j.github.io/cargotracker/. There are some highlights when comparing to the upstream project. -* Utilize Docker to run a Postgres Database in both development and production to erase the risk brought by different enviroments. +* Utilize Docker to run a Postgres Database in both development and production to erase the risk brought by different environments. * Add support to run application on WildFly. -* Add several fine-grained Maven profilles for varied Arquillian Container adapters, which is derived from [Jakarta EE 8 template project](https://github.com/hantsy/jakartaee8-starter-boilerplate). -* Replace Primefaces with simple Bootstrap css style and plain Facelets templates, clean up and reorginize all Facelets templates. +* Add several fine-grained Maven profiles for varied Arquillian Container adapters, which is derived from [Jakarta EE 10 template project](https://github.com/hantsy/jakartaee10-starter-boilerplate). +* Replace Primefaces with simple Bootstrap css style and plain Facelets templates, clean up and reorganize all Facelets templates. * Add a plenty of testing codes to cover more use cases. -* Add Github Actions workflows to build the project and run testing codes, and generate code quality report via Jacoco, SonarCloud. +* Add GitHub Actions workflows to build the project and run testing codes, and generate code quality report via Jacoco, SonarCloud. -## Building +## Build and Run ### Prerequisites -* Java 11 -* Apache Maven 3.8.1 +* Java 21 +* Apache Maven 3.9.0 * Git * Docker -* A Jakarta EE 8 compatible application server - * [Payara 5](https://www.payara.fish/downloads/) - * [WildFly 26](https://www.wildfly.org) +* [GlassFish v7](https://github.com/eclipse-ee4j/glassfish) or [WildFly 30](https://www.wildfly.org) ### Startup PostgresSQL Database @@ -44,12 +44,12 @@ In your terminal, switch to the project root folder, and run the following comma docker-compose up postgres ``` -### Payara 5 +### GlassFish v7 -Run the following command to run the application on Payara 5 using cargo maven plugin. +Run the following command to run the application on GlassFish v7 using cargo maven plugin. ```bash -mvn clean package cargo:run +mvn clean package cargo:run -Pglassifsh ``` Open your browser, go to http://localhost:8080/cargo-tracker @@ -65,23 +65,24 @@ Open your browser, go to http://localhost:8080/cargo-tracker ## Testing -Cargo Tracker's testing is done using [JUnit](https://junit.org) and [Arquillian](http://arquillian.org/). There are several Maven profiles configured for running the testing codes against varied Arquillian Container adapters. +Cargo Tracker's testing is done using [JUnit](https://junit.org) and [Arquillian](http://arquillian.org/). -### Payara 5 +There are several Maven profiles configured for running the testing codes against varied Arquillian Container adapters. -Run the following command to run Arquillian tests against Payara Managed Adaper. +### GlassFish + +Run the following command to run Arquillian tests against Payara Managed Adapter. ```bash -mvn clean verify -Parq-payara-managed -DskipTests=false +mvn clean verify -Parq-glassfish-managed ``` ### WildFly -Run the following command to run Arquillian tests against WildFly Managed Adaper. +Run the following command to run Arquillian tests against WildFly Managed Adapter. ```bash -mvn clean verify -Parq-wildfly-managed -DskipTests=false +mvn clean verify -Parq-wildfly-managed ``` - -> I have removed other profiles in the latest commits, if you are interested in other Arquillian Adapters, go to [Jakarta EE 8 template project](https://github.com/hantsy/jakartaee8-starter-boilerplate), and follow [the guides](https://hantsy.github.io/jakartaee8-starter-boilerplate/) and expereince yourself. +> More details about the Arquillian adapter's configuration, go to [Jakarta EE 10 template project](https://github.com/hantsy/jakartaee10-starter-boilerplate), and follow [the guides](https://hantsy.github.io/jakartaee9-starter-boilerplate/) to research them yourself. diff --git a/pom.xml b/pom.xml index dc6845b17..16cf316f3 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ UTF-8 UTF-8 - 11 + 21 3.11.0 @@ -37,50 +37,48 @@ 3.6.0 3.1.2 3.1.2 - 3.0.0-M7 + 3.1.2 1.10.10 - 8.0.0 + 10.0.0 - 1.6.0.Final + 1.7.1.Final - 4.13.2 + 5.10.0 2.2 - 4.11.0 + 5.6.0 3.24.2 2.8.0 0.8.11 - - true - - - 5.2022.4 - 2.4.6 - 1.21 + + 7.0.9 + 3.1.3 + 4.0.1 + 7.0.9 - 26.1.0.Final - 3.0.2.Final - - 4.0.0.Alpha5 - - 2.2.3.Final + 30.0.0.Final + 4.2.0.Final + 5.0.1.Final - 4.7.9.Final - 2.13.3 + 6.2.5.Final /tmp http://localhost:8080/cargo-tracker/rest/graph-traversal/shortest-path + + + true + true @@ -113,10 +111,18 @@ - junit - junit + org.junit + junit-bom ${junit.version} - test + import + pom + + + org.mockito + mockito-bom + ${mockito.version} + import + pom @@ -132,12 +138,6 @@ ${assertj.version} test - - org.mockito - mockito-core - ${mockito.version} - test - @@ -170,14 +170,6 @@ runtime - - - org.glassfish.jaxb - jaxb-runtime - 2.3.9 - provided - - org.apache.commons @@ -190,58 +182,41 @@ org.omnifaces omnifaces - 3.14.4 - - - - com.auth0 - mvc-auth-commons - 1.10.0 - - - - com.auth0 - jwks-rsa - 0.22.1 + 4.3 - junit - junit + org.jboss.arquillian.junit5 + arquillian-junit5-container test - + + - org.hamcrest - hamcrest + org.jboss.arquillian.protocol + arquillian-protocol-servlet-jakarta test - - org.assertj - assertj-core + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven test - - org.mockito - mockito-core + org.junit.jupiter + junit-jupiter test - - - org.jboss.arquillian.junit - arquillian-junit-container + org.mockito + mockito-junit-jupiter test - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven + org.assertj + assertj-core + ${assertj.version} test @@ -264,6 +239,15 @@ cargo-tracker + + + + org.codehaus.cargo + cargo-maven3-plugin + ${cargo-maven3-plugin.version} + + + org.apache.maven.plugins @@ -271,6 +255,13 @@ ${maven-compiler-plugin.version} true + + + org.eclipse.persistence + org.eclipse.persistence.jpa.modelgen.processor + ${eclipselink.version} + + @@ -287,11 +278,7 @@ maven-surefire-plugin ${maven-surefire-plugin.version} - ${skipTests} - - **/*Test.java - - org.eclipse.cargotracker.IntegrationTests + ${skip.unit.tests} @@ -300,6 +287,12 @@ test + + + **/*Test.java + + arqtest + @@ -308,14 +301,7 @@ maven-failsafe-plugin ${maven-failsafe-plugin.version} - - ${skipTests} - - **/*Test.java - - org.eclipse.cargotracker.IntegrationTests - !org.eclipse.cargotracker.IntegrationTests + ${skip.integration.tests} @@ -323,157 +309,245 @@ integration-test verify + + + **/*Test.java + + arqtest + !arqtest + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${maven-surefire-report-plugin.version} + + false + + + + - default - - true - + wildfly + + + wildfly-dist + standalone-full.xml + ${project.build.directory}/wildfly-${wildfly.version} + + + - org.codehaus.cargo - cargo-maven3-plugin - ${cargo-maven3-plugin.version} + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + unpack + process-resources + + unpack + + + + + org.wildfly + ${wildfly.artifactId} + ${wildfly.version} + zip + false + ${project.build.directory} + + + + + + + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + ${wildfly-maven-plugin.version} - - payara - - fish.payara.distributions - payara - ${payara.version} - - - - - - - + + + + + + + + + + + + + + + + opensaml + https://build.shibboleth.net/nexus/content/repositories/releases/ + + - payara-remote + glassfish + + ${project.basedir}/../installs + - - + + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + copy + process-classes + + copy + + + + + org.glassfish.jersey.ext.cdi + jersey-cdi-rs-inject + ${jersey.version} + jar + false + + + + ${project.build.directory}/cargo/installs/glassfish-${glassfish.version}/glassfish7/glassfish/modules + + + + + org.codehaus.cargo cargo-maven3-plugin - ${cargo-maven3-plugin.version} - payara - remote + glassfish7x + + + + + https://github.com/eclipse-ee4j/glassfish/releases/download/${glassfish.version}/glassfish-${glassfish.version}.zip + + ${cargo.zipUrlInstaller.downloadDir} + - runtime + + ${project.build.directory}/glassfish7x-home - - - - org.glassfish.main.deployment - deployment-client - 5.1.0 - - - - org.glassfish.jaxb - jaxb-runtime - 2.3.9 - - - wildfly - - - org.jboss.resteasy - resteasy-json-binding-provider - ${resteasy.version} - provided - - - - - - - - org.wildfly.plugins - wildfly-maven-plugin - ${wildfly-maven-plugin.version} - - standalone-full.xml - - - - - - - - - - - - - - - + unit-test + + true + + + false + true + + - arq-payara-managed + arq-glassfish-managed - false - ${project.build.directory}/payara5 + true + false + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + test + - fish.payara.arquillian - payara-client-ee8 - ${arquillian-payara.version} + org.glassfish.jersey.media + jersey-media-json-binding + ${jersey.version} + test - org.glassfish.tyrus - tyrus-client - ${tyrus-client.version} + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} test - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus-client.version} + org.glassfish.jersey.core + jersey-client + ${jersey.version} test - - fish.payara.arquillian - arquillian-payara-server-managed - ${arquillian-payara.version} + com.github.hantsy.arquillian-container-glassfish-jakarta + arquillian-glassfish-managed-jakarta + ${arquillian-glassfish-jakarta.version} test + + + src/test/resources + + + src/test/arq-glassfish-managed + + org.apache.maven.plugins @@ -489,9 +563,9 @@ - fish.payara.distributions - payara - ${payara.version} + org.glassfish.main.distributions + glassfish + ${glassfish.version} zip false ${project.build.directory} @@ -499,6 +573,27 @@ + + copy + pre-integration-test + + copy + + + + + org.glassfish.jersey.ext.cdi + jersey-cdi-rs-inject + ${jersey.version} + jar + false + + + + ${project.build.directory}/glassfish7/glassfish/modules + + + @@ -506,8 +601,11 @@ maven-failsafe-plugin ${maven-failsafe-plugin.version} + + ${project.build.directory}/glassfish7 + - ${project.build.directory}/payara5 + glassfish-managed @@ -515,32 +613,94 @@ - - - - arq-wildfly-managed + arq-glassfish-remote - false + true + false + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-binding + ${jersey.version} + test + - org.glassfish.tyrus - tyrus-client - ${tyrus-client.version} + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} test - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus-client.version} + org.glassfish.jersey.core + jersey-client + ${jersey.version} test + + com.github.hantsy.arquillian-container-glassfish-jakarta + arquillian-glassfish-remote-jakarta + ${arquillian-glassfish-jakarta.version} + test + + + + + + src/test/resources + + + src/test/arq-glassfish-remote + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + glassfish-remote + + + + + + + + + + + + arq-wildfly-managed + + true + false + standalone-full.xml + ${project.build.directory}/wildfly-${wildfly.version} + + + + - + org.jboss.resteasy resteasy-client @@ -548,16 +708,31 @@ test - jakarta.servlet - jakarta.servlet-api + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy.version} + test + + + + org.wildfly.arquillian wildfly-arquillian-container-managed @@ -567,6 +742,17 @@ + + + src/test/arq-wildfly-managed + + * + + + + src/test/resources + + org.apache.maven.plugins @@ -599,21 +785,102 @@ ${maven-failsafe-plugin.version} - ${project.build.directory}/wildfly-${wildfly.version} + + ${project.build.directory}/wildfly-${wildfly.version} + - standalone-full.xml - org.jboss.logmanager.LogManager + wildfly-managed + standalone-full.xml + + + + + arq-wildfly-remote + + true + false + + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy.version} + test + + + + + + org.wildfly.arquillian + wildfly-arquillian-container-remote + ${wildfly-arquillian.version} + test + + + + + + src/test/arq-wildfly-remote + + * + + + + src/test/resources + + + + + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + wildfly-remote + + + --add-opens java.base/java.io=ALL-UNNAMED + + + + + + coverage - 0.8.6 + 0.8.11 1.1.0 @@ -675,4 +942,37 @@ + + + sonatype-snapshots + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + false + + + true + + + + sonatype-nexus-staging + Sonatype Nexus Staging + https://jakarta.oss.sonatype.org/content/repositories/staging/ + + true + + + true + + + + payara-nexus + Payara Nexus Artifacts + https://nexus.payara.fish/repository/payara-artifacts/ + + + jitpack.io + https://jitpack.io + + diff --git a/src/main/java/org/eclipse/cargotracker/application/BookingService.java b/src/main/java/org/eclipse/cargotracker/application/BookingService.java index 2b2e2aaef..df60c699c 100644 --- a/src/main/java/org/eclipse/cargotracker/application/BookingService.java +++ b/src/main/java/org/eclipse/cargotracker/application/BookingService.java @@ -1,25 +1,29 @@ package org.eclipse.cargotracker.application; -import java.time.LocalDate; -import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.Future; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Future; +import jakarta.validation.constraints.NotNull; import org.eclipse.cargotracker.domain.model.cargo.Itinerary; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; import org.eclipse.cargotracker.domain.model.location.UnLocode; -/** Cargo booking service. */ -// TODO [Jakarta EE 8] Adopt the Date-Time API. +import java.time.LocalDate; +import java.util.List; + +/** + * Cargo booking service. + */ public interface BookingService { - /** Registers a new cargo in the tracking system, not yet routed. */ + /** + * Registers a new cargo in the tracking system, not yet routed. + */ TrackingId bookNewCargo( @NotNull(message = "Origin is required") @Valid UnLocode origin, @NotNull(message = "Destination is required") @Valid UnLocode destination, @NotNull(message = "Deadline is required") - @Future(message = "Deadline must be in the future") - LocalDate arrivalDeadline); + @Future(message = "Deadline must be in the future") + LocalDate arrivalDeadline); /** * Requests a list of itineraries describing possible routes for this cargo. @@ -41,6 +45,6 @@ void changeDestination( void changeDeadline( @NotNull(message = "Tracking ID is required") @Valid TrackingId trackingId, @NotNull(message = "Deadline is required") - @Future(message = "Deadline must be in the future") - LocalDate deadline); + @Future(message = "Deadline must be in the future") + LocalDate deadline); } diff --git a/src/main/java/org/eclipse/cargotracker/application/CargoInspectionService.java b/src/main/java/org/eclipse/cargotracker/application/CargoInspectionService.java index a1fd0a7d5..35d4c28e6 100644 --- a/src/main/java/org/eclipse/cargotracker/application/CargoInspectionService.java +++ b/src/main/java/org/eclipse/cargotracker/application/CargoInspectionService.java @@ -1,7 +1,7 @@ package org.eclipse.cargotracker.application; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; public interface CargoInspectionService { diff --git a/src/main/java/org/eclipse/cargotracker/application/HandlingEventService.java b/src/main/java/org/eclipse/cargotracker/application/HandlingEventService.java index 869d12130..3ba6c5bcc 100644 --- a/src/main/java/org/eclipse/cargotracker/application/HandlingEventService.java +++ b/src/main/java/org/eclipse/cargotracker/application/HandlingEventService.java @@ -1,7 +1,7 @@ package org.eclipse.cargotracker.application; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; import org.eclipse.cargotracker.domain.model.handling.CannotCreateHandlingEventException; import org.eclipse.cargotracker.domain.model.handling.HandlingEvent; @@ -21,6 +21,6 @@ void registerHandlingEvent( @NotNull(message = "Tracking ID is required.") @Valid TrackingId trackingId, @Valid VoyageNumber voyageNumber, @NotNull(message = "Location is required.") @Valid UnLocode unLocode, - @NotNull(message = "Type is required.") HandlingEvent.Type type) - throws CannotCreateHandlingEventException; + @NotNull(message = "Type is required.") HandlingEvent.Type type + ) throws CannotCreateHandlingEventException; } diff --git a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultBookingService.java b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultBookingService.java index ca8efab13..0fa0fea1f 100644 --- a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultBookingService.java +++ b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultBookingService.java @@ -7,8 +7,8 @@ import org.eclipse.cargotracker.domain.model.location.UnLocode; import org.eclipse.cargotracker.domain.service.RoutingService; -import javax.ejb.Stateless; -import javax.inject.Inject; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; import java.time.LocalDate; import java.util.Collections; import java.util.List; diff --git a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultCargoInspectionService.java b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultCargoInspectionService.java index c097f3952..f3271dc02 100644 --- a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultCargoInspectionService.java +++ b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultCargoInspectionService.java @@ -9,9 +9,9 @@ import org.eclipse.cargotracker.domain.model.handling.HandlingHistory; import org.eclipse.cargotracker.infrastructure.events.cdi.CargoInspected; -import javax.ejb.Stateless; -import javax.enterprise.event.Event; -import javax.inject.Inject; +import jakarta.ejb.Stateless; +import jakarta.enterprise.event.Event; +import jakarta.inject.Inject; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultHandlingEventService.java b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultHandlingEventService.java index 47648fbde..5fcd7c7ed 100644 --- a/src/main/java/org/eclipse/cargotracker/application/internal/DefaultHandlingEventService.java +++ b/src/main/java/org/eclipse/cargotracker/application/internal/DefaultHandlingEventService.java @@ -10,8 +10,8 @@ import org.eclipse.cargotracker.domain.model.location.UnLocode; import org.eclipse.cargotracker.domain.model.voyage.VoyageNumber; -import javax.ejb.Stateless; -import javax.inject.Inject; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; import java.time.LocalDateTime; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationMechanism.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationMechanism.java deleted file mode 100644 index 9ede8cf17..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationMechanism.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import com.auth0.AuthenticationController; -import com.auth0.IdentityVerificationException; -import com.auth0.Tokens; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.security.enterprise.AuthenticationException; -import javax.security.enterprise.AuthenticationStatus; -import javax.security.enterprise.authentication.mechanism.http.AutoApplySession; -import javax.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism; -import javax.security.enterprise.authentication.mechanism.http.HttpMessageContext; -import javax.security.enterprise.identitystore.CredentialValidationResult; -import javax.security.enterprise.identitystore.IdentityStoreHandler; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author hantsy - */ -@ApplicationScoped -@AutoApplySession -public class Auth0AuthenticationMechanism implements HttpAuthenticationMechanism { - - private static final Logger LOGGER = - Logger.getLogger(Auth0AuthenticationMechanism.class.getName()); - - private final AuthenticationController authenticationController; - private final IdentityStoreHandler identityStoreHandler; - - @Inject - Auth0AuthenticationMechanism( - AuthenticationController authenticationController, - IdentityStoreHandler identityStoreHandler) { - this.authenticationController = authenticationController; - this.identityStoreHandler = identityStoreHandler; - } - - @Override - public AuthenticationStatus validateRequest( - HttpServletRequest httpServletRequest, - HttpServletResponse httpServletResponse, - HttpMessageContext httpMessageContext) - throws AuthenticationException { - - // Exchange the code for the ID token, and notify container of result. - if (isCallbackRequest(httpServletRequest)) { - try { - Tokens tokens = - authenticationController.handle(httpServletRequest, httpServletResponse); - Auth0JwtCredential auth0JwtCredential = new Auth0JwtCredential(tokens.getIdToken()); - CredentialValidationResult result = - identityStoreHandler.validate(auth0JwtCredential); - return httpMessageContext.notifyContainerAboutLogin(result); - } catch (IdentityVerificationException e) { - LOGGER.log(Level.WARNING, "authentication failed: {0}", e.getMessage()); - return httpMessageContext.responseUnauthorized(); - } - } - return httpMessageContext.doNothing(); - } - - private boolean isCallbackRequest(HttpServletRequest request) { - return request.getRequestURI().endsWith("/callback") - && request.getParameter("code") != null; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationProvider.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationProvider.java deleted file mode 100644 index 58fd3aecf..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0AuthenticationProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import com.auth0.AuthenticationController; -import com.auth0.jwk.JwkProvider; -import com.auth0.jwk.JwkProviderBuilder; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; - -/** - * @author hantsy - */ -@ApplicationScoped -public class Auth0AuthenticationProvider { - - @Produces - public AuthenticationController authenticationController(Auth0Config config) { - JwkProvider jwkProvider = new JwkProviderBuilder(config.getDomain()).build(); - return AuthenticationController.newBuilder( - config.getDomain(), config.getClientId(), config.getClientSecret()) - .withJwkProvider(jwkProvider) - .build(); - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0Config.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0Config.java deleted file mode 100644 index e8e35710c..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0Config.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Named; - -import java.io.IOException; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -@ApplicationScoped -@Named("auth0Config") -public class Auth0Config { - - private static final Logger LOGGER = Logger.getLogger(Auth0Config.class.getName()); - - private static final String DEFAULT_SCOPE = "openid profile email"; - private String domain; - private String clientId; - private String clientSecret; - private String issuerUri; - private String scope; - - @PostConstruct - void init() { - LOGGER.config("Auth0Config.init()"); - try { - var properties = new Properties(); - properties.load(getClass().getResourceAsStream("/auth0.properties")); - domain = properties.getProperty("domain"); - clientId = properties.getProperty("clientId"); - clientSecret = properties.getProperty("clientSecret"); - issuerUri = properties.getProperty("issuerUri"); - scope = properties.getProperty("scope"); - - if (scope == null) { - scope = DEFAULT_SCOPE; - } - - if (issuerUri == null && domain != null) { - issuerUri = "https://" + this.domain + "/"; - } - - LOGGER.log( - Level.INFO, - "domain: {0}, clientId: {1}, clientSecret:{2}, issuerUri: {3}, scope: {4}", - new Object[] {domain, clientId, clientSecret, issuerUri, scope}); - } catch (IOException e) { - LOGGER.log(Level.SEVERE, "Failed to load auth0.properties", e); - } - } - - public String getDomain() { - return domain; - } - - public String getClientId() { - return clientId; - } - - public String getClientSecret() { - return clientSecret; - } - - public String getIssuerUri() { - return issuerUri; - } - - public String getScope() { - return scope; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtCredential.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtCredential.java deleted file mode 100644 index 54bee427b..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtCredential.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import com.auth0.jwt.JWT; -import com.auth0.jwt.interfaces.DecodedJWT; -import javax.security.enterprise.credential.Credential; - -/** - * @author hantsy - */ -class Auth0JwtCredential implements Credential { - private final Auth0JwtPrincipal auth0JwtPrincipal; - - Auth0JwtCredential(String token) { - DecodedJWT decodedJWT = JWT.decode(token); - this.auth0JwtPrincipal = new Auth0JwtPrincipal(decodedJWT); - } - - Auth0JwtPrincipal getAuth0JwtPrincipal() { - return auth0JwtPrincipal; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtIdentityStore.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtIdentityStore.java deleted file mode 100644 index 4f9937a80..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtIdentityStore.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import java.util.Set; -import javax.enterprise.context.ApplicationScoped; -import javax.security.enterprise.credential.Credential; -import javax.security.enterprise.identitystore.CredentialValidationResult; -import javax.security.enterprise.identitystore.IdentityStore; -import static javax.security.enterprise.identitystore.IdentityStore.ValidationType.VALIDATE; - -/** - * @author hantsy - */ -@ApplicationScoped -public class Auth0JwtIdentityStore implements IdentityStore { - - @Override - public CredentialValidationResult validate(final Credential credential) { - CredentialValidationResult result = CredentialValidationResult.NOT_VALIDATED_RESULT; - if (credential instanceof Auth0JwtCredential) { - Auth0JwtCredential auth0JwtCredential = (Auth0JwtCredential) credential; - result = new CredentialValidationResult(auth0JwtCredential.getAuth0JwtPrincipal()); - } - return result; - } - - @Override - public Set validationTypes() { - return Set.of(VALIDATE); - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtPrincipal.java b/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtPrincipal.java deleted file mode 100644 index b7e117c5c..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/Auth0JwtPrincipal.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import com.auth0.jwt.interfaces.DecodedJWT; -import javax.security.enterprise.CallerPrincipal; - -/** - * @author hantsy - */ -public class Auth0JwtPrincipal extends CallerPrincipal { - private final DecodedJWT idToken; - - Auth0JwtPrincipal(DecodedJWT idToken) { - super(idToken.getClaim("name").asString()); - this.idToken = idToken; - } - - public DecodedJWT getIdToken() { - return this.idToken; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/security/AuthorizationIdentityStore.java b/src/main/java/org/eclipse/cargotracker/application/security/AuthorizationIdentityStore.java deleted file mode 100644 index e2b67aecf..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/security/AuthorizationIdentityStore.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cargotracker.application.security; - -import javax.enterprise.context.ApplicationScoped; -import javax.security.enterprise.identitystore.CredentialValidationResult; -import javax.security.enterprise.identitystore.IdentityStore; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import static javax.security.enterprise.identitystore.IdentityStore.ValidationType.PROVIDE_GROUPS; - -@ApplicationScoped -public class AuthorizationIdentityStore implements IdentityStore { - private static final Logger LOGGER = - Logger.getLogger(AuthorizationIdentityStore.class.getName()); - - private final Map> authorization = - Map.of( - "user", Set.of("ADMIN", "USER"), - "auth0|63249de53e292439f31c6be6", Set.of("ADMIN", "USER"), - "user@example.com", Set.of("ADMIN", "USER")); // user in okta. - - @Override - public Set validationTypes() { - return EnumSet.of(PROVIDE_GROUPS); - } - - @Override - public Set getCallerGroups(CredentialValidationResult validationResult) { - var principal = validationResult.getCallerPrincipal().getName(); - LOGGER.log(Level.INFO, "Get principal name in validation result: {0}", principal); - return authorization.get(principal) == null - ? Collections.emptySet() - : authorization.get(principal); - } -} diff --git a/src/main/java/org/eclipse/cargotracker/application/util/RestConfiguration.java b/src/main/java/org/eclipse/cargotracker/application/util/RestConfiguration.java deleted file mode 100644 index 763145478..000000000 --- a/src/main/java/org/eclipse/cargotracker/application/util/RestConfiguration.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.eclipse.cargotracker.application.util; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** JAX-RS configuration. */ -@ApplicationPath("rest") -public class RestConfiguration extends Application {} diff --git a/src/main/java/org/eclipse/cargotracker/application/util/SampleDataGenerator.java b/src/main/java/org/eclipse/cargotracker/application/util/SampleDataGenerator.java index 2910eb64b..fb496c362 100644 --- a/src/main/java/org/eclipse/cargotracker/application/util/SampleDataGenerator.java +++ b/src/main/java/org/eclipse/cargotracker/application/util/SampleDataGenerator.java @@ -5,14 +5,14 @@ import org.eclipse.cargotracker.domain.model.location.SampleLocations; import org.eclipse.cargotracker.domain.model.voyage.SampleVoyages; -import javax.annotation.PostConstruct; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.annotation.PostConstruct; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.ejb.TransactionAttribute; +import jakarta.ejb.TransactionAttributeType; +import jakarta.inject.Inject; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Arrays; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Cargo.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Cargo.java index d5dda9f60..0ee0c4cb3 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Cargo.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Cargo.java @@ -1,6 +1,6 @@ package org.eclipse.cargotracker.domain.model.cargo; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -9,7 +9,7 @@ import org.eclipse.cargotracker.domain.model.location.Location; import org.eclipse.cargotracker.domain.shared.DomainObjectUtils; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.logging.Logger; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Delivery.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Delivery.java index c8d243020..efe0f5518 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Delivery.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Delivery.java @@ -9,8 +9,8 @@ import org.eclipse.cargotracker.domain.model.voyage.Voyage; import org.eclipse.cargotracker.domain.shared.DomainObjectUtils; -import javax.persistence.*; -import javax.validation.constraints.NotNull; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Iterator; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/HandlingActivity.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/HandlingActivity.java index dcadf2236..863d7ea3d 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/HandlingActivity.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/HandlingActivity.java @@ -1,6 +1,6 @@ package org.eclipse.cargotracker.domain.model.cargo; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -8,7 +8,7 @@ import org.eclipse.cargotracker.domain.model.location.Location; import org.eclipse.cargotracker.domain.model.voyage.Voyage; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; /** diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Itinerary.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Itinerary.java index 6a622ea4a..c29db0166 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Itinerary.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Itinerary.java @@ -1,12 +1,12 @@ package org.eclipse.cargotracker.domain.model.cargo; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import org.apache.commons.lang3.Validate; import org.eclipse.cargotracker.domain.model.handling.HandlingEvent; import org.eclipse.cargotracker.domain.model.location.Location; -import javax.persistence.*; -import javax.validation.constraints.Size; +import jakarta.persistence.*; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Collections; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Leg.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Leg.java index a32625723..c64d23cfc 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Leg.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/Leg.java @@ -6,8 +6,8 @@ import org.eclipse.cargotracker.domain.model.location.Location; import org.eclipse.cargotracker.domain.model.voyage.Voyage; -import javax.persistence.*; -import javax.validation.constraints.NotNull; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecification.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecification.java index e1d3f2e53..431980fdf 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecification.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecification.java @@ -6,11 +6,11 @@ import org.eclipse.cargotracker.domain.model.location.Location; import org.eclipse.cargotracker.domain.shared.AbstractSpecification; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDate; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/TrackingId.java b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/TrackingId.java index 67d596d9d..6204f0b3d 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/cargo/TrackingId.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/cargo/TrackingId.java @@ -1,10 +1,10 @@ package org.eclipse.cargotracker.domain.model.cargo; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import org.apache.commons.lang3.Validate; -import javax.persistence.Column; -import javax.persistence.Embeddable; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; import java.io.Serializable; /** Uniquely identifies a particular cargo. Automatically generated by the application. */ diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/handling/CannotCreateHandlingEventException.java b/src/main/java/org/eclipse/cargotracker/domain/model/handling/CannotCreateHandlingEventException.java index 9763c0349..84228bc8b 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/handling/CannotCreateHandlingEventException.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/handling/CannotCreateHandlingEventException.java @@ -1,6 +1,6 @@ package org.eclipse.cargotracker.domain.model.handling; -import javax.ejb.ApplicationException; +import jakarta.ejb.ApplicationException; /** * If a {@link HandlingEvent} can't be created from a given set of parameters. diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEvent.java b/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEvent.java index 2fdfe725c..5da210fb4 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEvent.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEvent.java @@ -9,8 +9,8 @@ import org.eclipse.cargotracker.domain.model.voyage.Voyage; import org.eclipse.cargotracker.domain.shared.DomainObjectUtils; -import javax.persistence.*; -import javax.validation.constraints.NotNull; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventFactory.java b/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventFactory.java index 9ad063dab..08554b6dd 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventFactory.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventFactory.java @@ -10,8 +10,8 @@ import org.eclipse.cargotracker.domain.model.voyage.VoyageNumber; import org.eclipse.cargotracker.domain.model.voyage.VoyageRepository; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.io.Serializable; import java.time.LocalDateTime; import java.util.logging.Logger; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/location/Location.java b/src/main/java/org/eclipse/cargotracker/domain/model/location/Location.java index 967b72044..c3625c492 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/location/Location.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/location/Location.java @@ -1,16 +1,13 @@ package org.eclipse.cargotracker.domain.model.location; -import java.io.Serializable; -import javax.persistence.Embedded; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.Validate; import org.eclipse.cargotracker.application.util.LocationUtil; +import java.io.Serializable; + /** * A location in our model is stops on a journey, such as cargo origin or destination, or carrier * movement end points. @@ -27,9 +24,15 @@ public class Location implements Serializable { // Special Location object that marks an unknown location. public static final Location UNKNOWN = new Location(new UnLocode("XXXXX"), "Unknown location"); private static final long serialVersionUID = 1L; - @Id @GeneratedValue private Long id; - @Embedded @NotNull private UnLocode unLocode; - @NotEmpty private String name; + + @Id + @GeneratedValue + private Long id; + @Embedded + @NotNull + private UnLocode unLocode; + @NotEmpty + private String name; public Location() { // Nothing to do. @@ -37,7 +40,7 @@ public Location() { /** * @param unLocode UN Locode - * @param name Location name + * @param name Location name * @throws IllegalArgumentException if the UN Locode or name is null */ public Location(UnLocode unLocode, String name) { diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/location/UnLocode.java b/src/main/java/org/eclipse/cargotracker/domain/model/location/UnLocode.java index 6a2af3dd4..0acb30246 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/location/UnLocode.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/location/UnLocode.java @@ -1,10 +1,10 @@ package org.eclipse.cargotracker.domain.model.location; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import org.apache.commons.lang3.Validate; -import javax.persistence.Embeddable; -import javax.validation.constraints.Pattern; +import jakarta.persistence.Embeddable; +import jakarta.validation.constraints.Pattern; import java.io.Serializable; /** diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/CarrierMovement.java b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/CarrierMovement.java index d0f62be50..ef0adf45e 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/CarrierMovement.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/CarrierMovement.java @@ -5,8 +5,8 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.eclipse.cargotracker.domain.model.location.Location; -import javax.persistence.*; -import javax.validation.constraints.NotNull; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Schedule.java b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Schedule.java index 2475537f6..23f6ff50f 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Schedule.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Schedule.java @@ -1,10 +1,11 @@ package org.eclipse.cargotracker.domain.model.voyage; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; -import javax.persistence.*; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.Collections; import java.util.List; @@ -33,7 +34,7 @@ public Schedule() { // Nothing to initialize. } - public Schedule(List carrierMovements) { + public Schedule(@Nonnull List carrierMovements) { Validate.notNull(carrierMovements); Validate.noNullElements(carrierMovements); Validate.notEmpty(carrierMovements); diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Voyage.java b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Voyage.java index 6c9531882..5b17e7865 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Voyage.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/Voyage.java @@ -4,12 +4,12 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import javax.persistence.Embedded; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQuery; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.Validate; import org.eclipse.cargotracker.domain.model.location.Location; diff --git a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/VoyageNumber.java b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/VoyageNumber.java index 3135c7b73..ecb7ce2e9 100644 --- a/src/main/java/org/eclipse/cargotracker/domain/model/voyage/VoyageNumber.java +++ b/src/main/java/org/eclipse/cargotracker/domain/model/voyage/VoyageNumber.java @@ -1,10 +1,10 @@ package org.eclipse.cargotracker.domain.model.voyage; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import org.apache.commons.lang3.Validate; -import javax.persistence.Column; -import javax.persistence.Embeddable; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; import java.io.Serializable; @Embeddable diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/events/cdi/CargoInspected.java b/src/main/java/org/eclipse/cargotracker/infrastructure/events/cdi/CargoInspected.java index 23e2ca0c0..473c6231c 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/events/cdi/CargoInspected.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/events/cdi/CargoInspected.java @@ -1,6 +1,6 @@ package org.eclipse.cargotracker.infrastructure.events.cdi; -import javax.inject.Qualifier; +import jakarta.inject.Qualifier; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/logging/LoggerProducer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/logging/LoggerProducer.java index 22e673a3f..d4f39339a 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/logging/LoggerProducer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/logging/LoggerProducer.java @@ -1,8 +1,8 @@ package org.eclipse.cargotracker.infrastructure.logging; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; -import javax.enterprise.inject.spi.InjectionPoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; +import jakarta.enterprise.inject.spi.InjectionPoint; import java.io.Serializable; import java.util.logging.Logger; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/JMSResourcesSetup.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/JMSResourcesSetup.java index 0efd7a341..024c81407 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/JMSResourcesSetup.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/JMSResourcesSetup.java @@ -1,46 +1,48 @@ package org.eclipse.cargotracker.infrastructure.messaging; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.jms.ConnectionFactory; -import javax.jms.JMSDestinationDefinition; -import javax.jms.JMSDestinationDefinitions; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.jms.ConnectionFactory; +import jakarta.jms.JMSDestinationDefinition; + import java.util.logging.Level; import java.util.logging.Logger; // A custom connection factory can connect to an external message broker. // @JMSConnectionFactoryDefinition(name = "java:comp/env/CargoTrackerCF") -// -// @JMSDestinationDefinition is not repeatable. -@JMSDestinationDefinitions({ - @JMSDestinationDefinition( - name = "java:app/jms/CargoHandledQueue", - // resourceAdapter = "jmsra", - interfaceName = "javax.jms.Queue", - destinationName = "CargoHandledQueue"), - @JMSDestinationDefinition( - name = "java:app/jms/MisdirectedCargoQueue", - // resourceAdapter = "jmsra", - interfaceName = "javax.jms.Queue", - destinationName = "MisdirectedCargoQueue"), - @JMSDestinationDefinition( - name = "java:app/jms/DeliveredCargoQueue", - // resourceAdapter = "jmsra", - interfaceName = "javax.jms.Queue", - destinationName = "DeliveredCargoQueue"), - @JMSDestinationDefinition( - name = "java:app/jms/RejectedRegistrationAttemptsQueue", - // resourceAdapter = "jmsra", - interfaceName = "javax.jms.Queue", - destinationName = "RejectedRegistrationAttemptsQueue"), - @JMSDestinationDefinition( - name = "java:app/jms/HandlingEventRegistrationAttemptQueue", - // resourceAdapter = "jmsra", - interfaceName = "javax.jms.Queue", - destinationName = "HandlingEventRegistrationAttemptQueue") -}) +@JMSDestinationDefinition( + name = "java:app/jms/CargoHandledQueue", + // resourceAdapter = "jmsra", + interfaceName = "jakarta.jms.Queue", + destinationName = "CargoHandledQueue" +) +@JMSDestinationDefinition( + name = "java:app/jms/MisdirectedCargoQueue", + // resourceAdapter = "jmsra", + interfaceName = "jakarta.jms.Queue", + destinationName = "MisdirectedCargoQueue" +) +@JMSDestinationDefinition( + name = "java:app/jms/DeliveredCargoQueue", + // resourceAdapter = "jmsra", + interfaceName = "jakarta.jms.Queue", + destinationName = "DeliveredCargoQueue" +) +@JMSDestinationDefinition( + name = "java:app/jms/RejectedRegistrationAttemptsQueue", + // resourceAdapter = "jmsra", + interfaceName = "jakarta.jms.Queue", + destinationName = "RejectedRegistrationAttemptsQueue" +) +@JMSDestinationDefinition( + name = "java:app/jms/HandlingEventRegistrationAttemptQueue", + // resourceAdapter = "jmsra", + interfaceName = "jakarta.jms.Queue", + destinationName = "HandlingEventRegistrationAttemptQueue" +) + @Startup @Singleton public class JMSResourcesSetup { @@ -51,6 +53,6 @@ public class JMSResourcesSetup { @PostConstruct public void init() { - LOGGER.log(Level.INFO, "JMS connectionFactory : {0} ", connectionFactory != null); + LOGGER.log(Level.INFO, "JMS connectionFactory is available : {0} ", connectionFactory != null); } } diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/CargoHandledConsumer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/CargoHandledConsumer.java index 9945758e0..1552e761d 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/CargoHandledConsumer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/CargoHandledConsumer.java @@ -3,13 +3,13 @@ import org.eclipse.cargotracker.application.CargoInspectionService; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.inject.Inject; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; +import jakarta.ejb.ActivationConfigProperty; +import jakarta.ejb.MessageDriven; +import jakarta.inject.Inject; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; +import jakarta.jms.TextMessage; import java.util.logging.Level; import java.util.logging.Logger; @@ -23,7 +23,7 @@ activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", - propertyValue = "javax.jms.Queue"), + propertyValue = "jakarta.jms.Queue"), @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "java:app/jms/CargoHandledQueue") diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/DeliveredCargoConsumer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/DeliveredCargoConsumer.java index d8d493eb2..ac1e87269 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/DeliveredCargoConsumer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/DeliveredCargoConsumer.java @@ -1,11 +1,11 @@ package org.eclipse.cargotracker.infrastructure.messaging.jms; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.inject.Inject; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; +import jakarta.ejb.ActivationConfigProperty; +import jakarta.ejb.MessageDriven; +import jakarta.inject.Inject; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; import java.util.logging.Level; import java.util.logging.Logger; @@ -13,7 +13,7 @@ activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", - propertyValue = "javax.jms.Queue"), + propertyValue = "jakarta.jms.Queue"), @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "java:app/jms/DeliveredCargoQueue") diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/HandlingEventRegistrationAttemptConsumer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/HandlingEventRegistrationAttemptConsumer.java index 2413bf397..7244d1858 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/HandlingEventRegistrationAttemptConsumer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/HandlingEventRegistrationAttemptConsumer.java @@ -4,20 +4,20 @@ import org.eclipse.cargotracker.domain.model.handling.CannotCreateHandlingEventException; import org.eclipse.cargotracker.interfaces.handling.HandlingEventRegistrationAttempt; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.inject.Inject; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.ObjectMessage; +import jakarta.ejb.ActivationConfigProperty; +import jakarta.ejb.MessageDriven; +import jakarta.inject.Inject; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; +import jakarta.jms.ObjectMessage; /** Consumes handling event registration attempt messages and delegates to proper registration. */ @MessageDriven( activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", - propertyValue = "javax.jms.Queue"), + propertyValue = "jakarta.jms.Queue"), @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "java:app/jms/HandlingEventRegistrationAttemptQueue") diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/JmsApplicationEvents.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/JmsApplicationEvents.java index cb1e49c83..bcdf741d2 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/JmsApplicationEvents.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/JmsApplicationEvents.java @@ -1,15 +1,15 @@ package org.eclipse.cargotracker.infrastructure.messaging.jms; +import jakarta.annotation.Resource; import org.eclipse.cargotracker.application.ApplicationEvents; import org.eclipse.cargotracker.domain.model.cargo.Cargo; import org.eclipse.cargotracker.domain.model.handling.HandlingEvent; import org.eclipse.cargotracker.interfaces.handling.HandlingEventRegistrationAttempt; -import javax.annotation.Resource; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.jms.Destination; -import javax.jms.JMSContext; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.jms.Destination; +import jakarta.jms.JMSContext; import java.io.Serializable; import java.util.logging.Level; import java.util.logging.Logger; @@ -24,13 +24,13 @@ public class JmsApplicationEvents implements ApplicationEvents, Serializable { @Resource(lookup = "java:app/jms/CargoHandledQueue") private Destination cargoHandledQueue; - @Resource(lookup = "java:app/jms/MisdirectedCargoQueue") + @jakarta.annotation.Resource(lookup = "java:app/jms/MisdirectedCargoQueue") private Destination misdirectedCargoQueue; - @Resource(lookup = "java:app/jms/DeliveredCargoQueue") + @jakarta.annotation.Resource(lookup = "java:app/jms/DeliveredCargoQueue") private Destination deliveredCargoQueue; - @Resource(lookup = "java:app/jms/HandlingEventRegistrationAttemptQueue") + @jakarta.annotation.Resource(lookup = "java:app/jms/HandlingEventRegistrationAttemptQueue") private Destination handlingEventQueue; @Inject private Logger logger; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/MisdirectedCargoConsumer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/MisdirectedCargoConsumer.java index f26f0fa8f..e976726e3 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/MisdirectedCargoConsumer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/MisdirectedCargoConsumer.java @@ -1,11 +1,11 @@ package org.eclipse.cargotracker.infrastructure.messaging.jms; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.inject.Inject; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; +import jakarta.ejb.ActivationConfigProperty; +import jakarta.ejb.MessageDriven; +import jakarta.inject.Inject; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; import java.util.logging.Level; import java.util.logging.Logger; @@ -13,7 +13,7 @@ activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", - propertyValue = "javax.jms.Queue"), + propertyValue = "jakarta.jms.Queue"), @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "java:app/jms/MisdirectedCargoQueue") diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/RejectedRegistrationAttemptsConsumer.java b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/RejectedRegistrationAttemptsConsumer.java index a0a7bef91..00446232a 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/RejectedRegistrationAttemptsConsumer.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/messaging/jms/RejectedRegistrationAttemptsConsumer.java @@ -1,11 +1,11 @@ package org.eclipse.cargotracker.infrastructure.messaging.jms; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.inject.Inject; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; +import jakarta.ejb.ActivationConfigProperty; +import jakarta.ejb.MessageDriven; +import jakarta.inject.Inject; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; import java.util.logging.Level; import java.util.logging.Logger; @@ -13,7 +13,7 @@ activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", - propertyValue = "javax.jms.Queue"), + propertyValue = "jakarta.jms.Queue"), @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "java:app/jms/RejectedRegistrationAttemptsQueue") diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/DatabaseSetup.java b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/DatabaseSetup.java index fe9292ba1..7bd598963 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/DatabaseSetup.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/DatabaseSetup.java @@ -1,23 +1,16 @@ package org.eclipse.cargotracker.infrastructure.persistence; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.annotation.sql.DataSourceDefinition; -import javax.ejb.Singleton; -import javax.ejb.Startup; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import jakarta.annotation.sql.DataSourceDefinition; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; -// H2 will cause deployment failed on payara server. -// -// @DataSourceDefinition( -// name = "java:app/jdbc/CargoTrackerDatabase", -// className = "org.h2.jdbcx.JdbcDataSource", -// url = "jdbc:h2:mem:test;DB_CLOSE_ON_EXIT=FALSE" -// ) @DataSourceDefinition( name = "java:app/jdbc/CargoTrackerDatabase", className = "org.postgresql.xa.PGXADataSource", @@ -34,8 +27,8 @@ public class DatabaseSetup { @PostConstruct public void init() { - LOGGER.info("calling DatabaseSetup..."); - LOGGER.log(Level.INFO, "dataSource is not null: {0}", dataSource != null); + LOGGER.config("calling DatabaseSetup..."); + LOGGER.log(Level.INFO, "dataSource is available: {0}", dataSource != null); try (Connection connection = dataSource.getConnection()) { LOGGER.log( diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaCargoRepository.java b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaCargoRepository.java index 65e50d5c1..c3d5680e8 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaCargoRepository.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaCargoRepository.java @@ -5,11 +5,11 @@ import org.eclipse.cargotracker.domain.model.cargo.Leg; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.persistence.EntityManager; +import jakarta.persistence.NoResultException; +import jakarta.persistence.PersistenceContext; import java.io.Serializable; import java.util.List; import java.util.UUID; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaHandlingEventRepository.java b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaHandlingEventRepository.java index efe528747..6a8d2e618 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaHandlingEventRepository.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaHandlingEventRepository.java @@ -5,9 +5,9 @@ import org.eclipse.cargotracker.domain.model.handling.HandlingEventRepository; import org.eclipse.cargotracker.domain.model.handling.HandlingHistory; -import javax.enterprise.context.ApplicationScoped; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import java.io.Serializable; @ApplicationScoped diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaLocationRepository.java b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaLocationRepository.java index 8c02abe06..067233638 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaLocationRepository.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaLocationRepository.java @@ -4,11 +4,11 @@ import org.eclipse.cargotracker.domain.model.location.LocationRepository; import org.eclipse.cargotracker.domain.model.location.UnLocode; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.persistence.EntityManager; +import jakarta.persistence.NoResultException; +import jakarta.persistence.PersistenceContext; import java.io.Serializable; import java.util.List; import java.util.logging.Level; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaVoyageRepository.java b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaVoyageRepository.java index aa1d8e03e..fc8d6a466 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaVoyageRepository.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/persistence/jpa/JpaVoyageRepository.java @@ -4,11 +4,11 @@ import org.eclipse.cargotracker.domain.model.voyage.VoyageNumber; import org.eclipse.cargotracker.domain.model.voyage.VoyageRepository; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.persistence.EntityManager; +import jakarta.persistence.NoResultException; +import jakarta.persistence.PersistenceContext; import java.io.Serializable; import java.util.List; import java.util.logging.Level; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/routing/ExternalRoutingService.java b/src/main/java/org/eclipse/cargotracker/infrastructure/routing/ExternalRoutingService.java index 939adb7e0..040629f7c 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/routing/ExternalRoutingService.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/routing/ExternalRoutingService.java @@ -12,8 +12,8 @@ import org.eclipse.pathfinder.api.TransitEdge; import org.eclipse.pathfinder.api.TransitPath; -import javax.ejb.Stateless; -import javax.inject.Inject; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; diff --git a/src/main/java/org/eclipse/cargotracker/infrastructure/routing/client/GraphTraversalResourceClient.java b/src/main/java/org/eclipse/cargotracker/infrastructure/routing/client/GraphTraversalResourceClient.java index df5a950c2..6af4fd1ce 100644 --- a/src/main/java/org/eclipse/cargotracker/infrastructure/routing/client/GraphTraversalResourceClient.java +++ b/src/main/java/org/eclipse/cargotracker/infrastructure/routing/client/GraphTraversalResourceClient.java @@ -1,24 +1,23 @@ package org.eclipse.cargotracker.infrastructure.routing.client; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.annotation.Resource; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.core.MediaType; import org.eclipse.pathfinder.api.TransitPath; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.annotation.Resource; -import javax.enterprise.context.ApplicationScoped; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @ApplicationScoped public class GraphTraversalResourceClient { - private static final Logger LOGGER = - Logger.getLogger(GraphTraversalResourceClient.class.getName()); + private static final Logger LOGGER = Logger.getLogger(GraphTraversalResourceClient.class.getName()); @Resource(lookup = "java:app/configuration/GraphTraversalUrl") private String graphTraversalUrl; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/FacesCDIActivator.java b/src/main/java/org/eclipse/cargotracker/interfaces/FacesCDIActivator.java new file mode 100644 index 000000000..270987a69 --- /dev/null +++ b/src/main/java/org/eclipse/cargotracker/interfaces/FacesCDIActivator.java @@ -0,0 +1,8 @@ +package org.eclipse.cargotracker.interfaces; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.faces.annotation.FacesConfig; + +@FacesConfig +@ApplicationScoped +public class FacesCDIActivator {} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/FacesConfigSetup.java b/src/main/java/org/eclipse/cargotracker/interfaces/FacesConfigSetup.java deleted file mode 100644 index e60166e23..000000000 --- a/src/main/java/org/eclipse/cargotracker/interfaces/FacesConfigSetup.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.eclipse.cargotracker.interfaces; - -import javax.enterprise.context.ApplicationScoped; -import javax.faces.annotation.FacesConfig; - -@FacesConfig(version = FacesConfig.Version.JSF_2_3) -@ApplicationScoped -public class FacesConfigSetup {} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/RestActivator.java b/src/main/java/org/eclipse/cargotracker/interfaces/RestActivator.java new file mode 100644 index 000000000..de8c757ac --- /dev/null +++ b/src/main/java/org/eclipse/cargotracker/interfaces/RestActivator.java @@ -0,0 +1,8 @@ +package org.eclipse.cargotracker.interfaces; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** JAX-RS configuration. */ +@ApplicationPath("rest") +public class RestActivator extends Application {} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/facade/internal/DefaultBookingServiceFacade.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/facade/internal/DefaultBookingServiceFacade.java index b5cd49da9..c8810497b 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/facade/internal/DefaultBookingServiceFacade.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/facade/internal/DefaultBookingServiceFacade.java @@ -21,9 +21,9 @@ import org.eclipse.cargotracker.interfaces.booking.facade.internal.assembler.ItineraryCandidateDtoAssembler; import org.eclipse.cargotracker.interfaces.booking.facade.internal.assembler.LocationDtoAssembler; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.transaction.Transactional; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; import java.io.Serializable; import java.time.LocalDate; import java.util.ArrayList; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/rest/CargoMonitoringService.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/rest/CargoMonitoringService.java index 18660ca93..74bc31b3b 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/rest/CargoMonitoringService.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/rest/CargoMonitoringService.java @@ -3,16 +3,16 @@ import org.eclipse.cargotracker.domain.model.cargo.Cargo; import org.eclipse.cargotracker.domain.model.cargo.CargoRepository; -import javax.ejb.Stateless; -import javax.inject.Inject; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonArrayBuilder; -import javax.json.JsonObjectBuilder; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonArrayBuilder; +import jakarta.json.JsonObjectBuilder; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.util.List; @Stateless diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/socket/RealtimeCargoTrackingService.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/socket/RealtimeCargoTrackingService.java index 8635e794f..c9bc45d99 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/socket/RealtimeCargoTrackingService.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/socket/RealtimeCargoTrackingService.java @@ -3,15 +3,15 @@ import org.eclipse.cargotracker.domain.model.cargo.Cargo; import org.eclipse.cargotracker.infrastructure.events.cdi.CargoInspected; -import javax.ejb.Singleton; -import javax.enterprise.event.Observes; -import javax.inject.Inject; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.websocket.OnClose; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.ejb.Singleton; +import jakarta.enterprise.event.Observes; +import jakarta.inject.Inject; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.websocket.OnClose; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Booking.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Booking.java index 683682396..6ba26aa07 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Booking.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Booking.java @@ -1,15 +1,15 @@ package org.eclipse.cargotracker.interfaces.booking.web; +import jakarta.annotation.PostConstruct; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.LocationDto; import org.omnifaces.util.Messages; -import javax.annotation.PostConstruct; -import javax.enterprise.context.Conversation; -import javax.enterprise.context.ConversationScoped; -import javax.faces.context.FacesContext; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.enterprise.context.Conversation; +import jakarta.enterprise.context.ConversationScoped; +import jakarta.faces.context.FacesContext; +import jakarta.inject.Inject; +import jakarta.inject.Named; import java.io.Serializable; import java.time.LocalDate; import java.time.temporal.ChronoUnit; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CallbackServlet.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CallbackServlet.java deleted file mode 100644 index a95abbf1b..000000000 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CallbackServlet.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.cargotracker.interfaces.booking.web; - -import java.io.IOException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author hantsy - */ -@WebServlet(urlPatterns = {"/callback"}) -public class CallbackServlet extends HttpServlet { - - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - String referer = (String) request.getSession().getAttribute("Referer"); - String redirectTo = referer != null ? referer : request.getContextPath() + "/admin/"; - response.sendRedirect(redirectTo); - } -} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CargoDetails.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CargoDetails.java index c00443be3..fa40d9163 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CargoDetails.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/CargoDetails.java @@ -1,8 +1,8 @@ package org.eclipse.cargotracker.interfaces.booking.web; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoRouteDto; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeArrivalDeadline.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeArrivalDeadline.java index 41629125e..fc554d3e5 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeArrivalDeadline.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeArrivalDeadline.java @@ -2,9 +2,9 @@ import java.io.Serializable; import java.time.LocalDate; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; import org.eclipse.cargotracker.application.util.DateUtil; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoRouteDto; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeDestination.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeDestination.java index 6db6a11c6..b61c39399 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeDestination.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ChangeDestination.java @@ -4,9 +4,9 @@ import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoRouteDto; import org.eclipse.cargotracker.interfaces.booking.facade.dto.LocationDto; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; import java.io.Serializable; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ItinerarySelection.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ItinerarySelection.java index c083aaffc..814463422 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ItinerarySelection.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ItinerarySelection.java @@ -2,9 +2,9 @@ import java.io.Serializable; import java.util.List; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoRouteDto; import org.eclipse.cargotracker.interfaces.booking.facade.dto.RouteCandidateDto; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ListCargo.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ListCargo.java index a7c3f155b..4aea2c250 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ListCargo.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/ListCargo.java @@ -2,10 +2,10 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoRouteDto; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LoginServlet.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LoginServlet.java deleted file mode 100644 index 076d98827..000000000 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LoginServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.cargotracker.interfaces.booking.web; - -import com.auth0.AuthenticationController; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.annotation.security.DeclareRoles; -import javax.inject.Inject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.eclipse.cargotracker.application.security.Auth0Config; - -/** - * @author hantsy - */ -@WebServlet(urlPatterns = "/login") -@DeclareRoles({"ADMIN", "USER"}) -public class LoginServlet extends HttpServlet { - - private static final Logger LOGGER = Logger.getLogger(LoginServlet.class.getName()); - - private final Auth0Config config; - private final AuthenticationController authenticationController; - - @Inject - LoginServlet(Auth0Config config, AuthenticationController authenticationController) { - this.config = config; - this.authenticationController = authenticationController; - } - - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - // URL where the application will receive the authorization code (e.g., - // http://localhost:3000/callback) - String callbackUrl = - String.format( - "%s://%s:%s%s/callback", - request.getScheme(), - request.getServerName(), - request.getServerPort(), - request.getContextPath()); - - LOGGER.log(Level.INFO, "callback url:{0}", callbackUrl); - - // Create the authorization URL to redirect the user to, to begin the authentication flow. - String authURL = - authenticationController - .buildAuthorizeUrl(request, response, callbackUrl) - .withScope(config.getScope()) - .build(); - - response.sendRedirect(authURL); - } -} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LogoutServlet.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LogoutServlet.java deleted file mode 100644 index 831821ed9..000000000 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/LogoutServlet.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.cargotracker.interfaces.booking.web; - -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.eclipse.cargotracker.application.security.Auth0Config; - -/** - * @author hantsy - */ -@WebServlet(urlPatterns = "/logout") -public class LogoutServlet extends HttpServlet { - private final Auth0Config config; - - @Inject - LogoutServlet(Auth0Config config) { - this.config = config; - } - - @Override - protected void doGet(final HttpServletRequest request, final HttpServletResponse response) - throws ServletException, IOException { - clearSession(request); - response.sendRedirect(getLogoutUrl(request)); - } - - private void clearSession(HttpServletRequest request) { - if (request.getSession() != null) { - request.getSession().invalidate(); - } - } - - private String getLogoutUrl(HttpServletRequest request) { - String returnUrl = String.format("%s://%s", request.getScheme(), request.getServerName()); - int port = request.getServerPort(); - String scheme = request.getScheme(); - - if (("http".equals(scheme) && port != 80) || ("https".equals(scheme) && port != 443)) { - returnUrl += ":" + port; - } - - returnUrl += request.getContextPath() + "/admin/"; - - // Build logout URL like: - // https://{YOUR-DOMAIN}/v2/logout?client_id={YOUR-CLIENT-ID}&returnTo=http://localhost:3000/ - String logoutUrl = - String.format( - "https://%s/v2/logout?client_id=%s&returnTo=%s", - config.getDomain(), config.getClientId(), returnUrl); - - return logoutUrl; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Profile.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Profile.java deleted file mode 100644 index 008437022..000000000 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Profile.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ -package org.eclipse.cargotracker.interfaces.booking.web; - -import com.auth0.jwt.interfaces.Claim; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.inject.Named; -import javax.security.enterprise.SecurityContext; -import org.eclipse.cargotracker.application.security.Auth0JwtPrincipal; - -/** - * @author hantsy - */ -@RequestScoped -@Named("profile") -public class Profile { - - private static final Logger LOGGER = Logger.getLogger(Profile.class.getName()); - - @Inject SecurityContext securityContext; - - private Map claims; - - public void load() { - LOGGER.log(Level.INFO, "get profile info."); - var principal = securityContext.getCallerPrincipal(); - if (principal instanceof Auth0JwtPrincipal) { - var jwtPrincipal = (Auth0JwtPrincipal) principal; - claims = jwtPrincipal.getIdToken().getClaims(); - LOGGER.log(Level.INFO, "jwt claims: {0}", claims); - } - } - - public Map getClaims() { - return claims; - } -} diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Registration.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Registration.java index 86f2d1b1d..0d1758abb 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Registration.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Registration.java @@ -2,12 +2,13 @@ import java.io.Serializable; import java.util.List; -import javax.annotation.PostConstruct; -import javax.faces.application.FacesMessage; -import javax.faces.context.FacesContext; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; + +import jakarta.faces.application.FacesMessage; +import jakarta.faces.context.FacesContext; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.annotation.PostConstruct; import org.eclipse.cargotracker.application.util.DateUtil; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.LocationDto; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Track.java b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Track.java index 996e8280a..d097040a1 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Track.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/booking/web/Track.java @@ -2,10 +2,11 @@ import java.io.Serializable; import java.util.List; -import javax.annotation.PostConstruct; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; + +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.annotation.PostConstruct; import org.eclipse.cargotracker.interfaces.booking.facade.BookingServiceFacade; import org.eclipse.cargotracker.interfaces.booking.facade.dto.CargoStatusDto; import org.omnifaces.util.Messages; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemReader.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemReader.java index c81866334..50b2dba0c 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemReader.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemReader.java @@ -7,11 +7,11 @@ import org.eclipse.cargotracker.domain.model.voyage.VoyageNumber; import org.eclipse.cargotracker.interfaces.handling.HandlingEventRegistrationAttempt; -import javax.batch.api.chunk.AbstractItemReader; -import javax.batch.runtime.context.JobContext; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.batch.api.chunk.AbstractItemReader; +import jakarta.batch.runtime.context.JobContext; +import jakarta.enterprise.context.Dependent; +import jakarta.inject.Inject; +import jakarta.inject.Named; import java.io.File; import java.io.RandomAccessFile; import java.io.Serializable; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemWriter.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemWriter.java index 40d641ebb..33928c8af 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemWriter.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/EventItemWriter.java @@ -6,12 +6,12 @@ import java.io.PrintWriter; import java.io.Serializable; import java.util.List; -import javax.batch.api.chunk.AbstractItemWriter; -import javax.batch.runtime.context.JobContext; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; -import javax.transaction.Transactional; +import jakarta.batch.api.chunk.AbstractItemWriter; +import jakarta.batch.runtime.context.JobContext; +import jakarta.enterprise.context.Dependent; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.transaction.Transactional; import org.eclipse.cargotracker.application.ApplicationEvents; import org.eclipse.cargotracker.application.util.DateUtil; import org.eclipse.cargotracker.interfaces.handling.HandlingEventRegistrationAttempt; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/FileProcessorJobListener.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/FileProcessorJobListener.java index 9a567bcd6..d4ce95519 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/FileProcessorJobListener.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/FileProcessorJobListener.java @@ -3,10 +3,10 @@ import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; -import javax.batch.api.listener.JobListener; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.batch.api.listener.JobListener; +import jakarta.enterprise.context.Dependent; +import jakarta.inject.Inject; +import jakarta.inject.Named; @Dependent @Named("FileProcessorJobListener") diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/LineParseExceptionListener.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/LineParseExceptionListener.java index ea4ead3e3..2abe0ff27 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/LineParseExceptionListener.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/LineParseExceptionListener.java @@ -6,11 +6,11 @@ import java.io.PrintWriter; import java.util.logging.Level; import java.util.logging.Logger; -import javax.batch.api.chunk.listener.SkipReadListener; -import javax.batch.runtime.context.JobContext; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.batch.api.chunk.listener.SkipReadListener; +import jakarta.batch.runtime.context.JobContext; +import jakarta.enterprise.context.Dependent; +import jakarta.inject.Inject; +import jakarta.inject.Named; @Dependent @Named("LineParseExceptionListener") diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/UploadDirectoryScanner.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/UploadDirectoryScanner.java index 5246a73b8..660035dc0 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/UploadDirectoryScanner.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/UploadDirectoryScanner.java @@ -1,11 +1,11 @@ package org.eclipse.cargotracker.interfaces.handling.file; -import javax.batch.operations.JobOperator; -import javax.batch.runtime.BatchRuntime; -import javax.ejb.Schedule; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; +import jakarta.batch.operations.JobOperator; +import jakarta.batch.runtime.BatchRuntime; +import jakarta.ejb.Schedule; +import jakarta.ejb.Stateless; +import jakarta.ejb.TransactionManagement; +import jakarta.ejb.TransactionManagementType; /** * Periodically scans a certain directory for files and attempts to parse handling event diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/mobile/EventLogger.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/mobile/EventLogger.java index 107249179..20f84e34d 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/mobile/EventLogger.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/mobile/EventLogger.java @@ -16,11 +16,11 @@ import org.eclipse.cargotracker.interfaces.handling.HandlingEventRegistrationAttempt; import org.omnifaces.util.Messages; -import javax.faces.model.SelectItem; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; -import javax.transaction.Transactional; +import jakarta.faces.model.SelectItem; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.transaction.Transactional; import java.io.Serializable; import java.time.LocalDateTime; import java.util.ArrayList; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReport.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReport.java index 6feadab32..c9e14a919 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReport.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReport.java @@ -1,7 +1,7 @@ package org.eclipse.cargotracker.interfaces.handling.rest; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; /** Transfer object for handling reports. */ public class HandlingReport { diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReportService.java b/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReportService.java index 2e28c624b..254534c26 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReportService.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReportService.java @@ -1,22 +1,22 @@ package org.eclipse.cargotracker.interfaces.handling.rest; -import static javax.ws.rs.core.Response.accepted; -import static javax.ws.rs.core.Response.status; +import static jakarta.ws.rs.core.Response.accepted; +import static jakarta.ws.rs.core.Response.status; import java.time.LocalDateTime; import java.util.Collections; import java.util.logging.Level; import java.util.logging.Logger; -import javax.ejb.Stateless; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import org.eclipse.cargotracker.application.ApplicationEvents; import org.eclipse.cargotracker.application.util.DateUtil; import org.eclipse.cargotracker.domain.model.cargo.TrackingId; diff --git a/src/main/java/org/eclipse/cargotracker/interfaces/tracking/web/Track.java b/src/main/java/org/eclipse/cargotracker/interfaces/tracking/web/Track.java index a83feeeb1..5ee7e31bb 100644 --- a/src/main/java/org/eclipse/cargotracker/interfaces/tracking/web/Track.java +++ b/src/main/java/org/eclipse/cargotracker/interfaces/tracking/web/Track.java @@ -7,10 +7,10 @@ import org.eclipse.cargotracker.domain.model.handling.HandlingEventRepository; import org.omnifaces.util.Messages; -import javax.faces.view.ViewScoped; -import javax.inject.Inject; -import javax.inject.Named; -import javax.transaction.Transactional; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.transaction.Transactional; import java.io.Serializable; import java.util.List; diff --git a/src/main/java/org/eclipse/pathfinder/api/GraphTraversalService.java b/src/main/java/org/eclipse/pathfinder/api/GraphTraversalService.java index c7ec34888..ebe794a0f 100644 --- a/src/main/java/org/eclipse/pathfinder/api/GraphTraversalService.java +++ b/src/main/java/org/eclipse/pathfinder/api/GraphTraversalService.java @@ -2,14 +2,14 @@ import org.eclipse.pathfinder.internal.GraphDao; -import javax.ejb.Stateless; -import javax.inject.Inject; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import jakarta.ejb.Stateless; +import jakarta.inject.Inject; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; import java.security.SecureRandom; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; diff --git a/src/main/java/org/eclipse/pathfinder/api/TransitPath.java b/src/main/java/org/eclipse/pathfinder/api/TransitPath.java index e64679585..940c69e20 100644 --- a/src/main/java/org/eclipse/pathfinder/api/TransitPath.java +++ b/src/main/java/org/eclipse/pathfinder/api/TransitPath.java @@ -1,6 +1,6 @@ package org.eclipse.pathfinder.api; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.io.Serializable; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/eclipse/pathfinder/internal/GraphDao.java b/src/main/java/org/eclipse/pathfinder/internal/GraphDao.java index c0c085799..b335d47ba 100644 --- a/src/main/java/org/eclipse/pathfinder/internal/GraphDao.java +++ b/src/main/java/org/eclipse/pathfinder/internal/GraphDao.java @@ -1,6 +1,6 @@ package org.eclipse.pathfinder.internal; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; import java.io.Serializable; import java.security.SecureRandom; import java.util.ArrayList; diff --git a/src/main/resources/META-INF/batch-jobs/EventFilesProcessorJob.xml b/src/main/resources/META-INF/batch-jobs/EventFilesProcessorJob.xml index 23c33275c..b4e7f7bcc 100644 --- a/src/main/resources/META-INF/batch-jobs/EventFilesProcessorJob.xml +++ b/src/main/resources/META-INF/batch-jobs/EventFilesProcessorJob.xml @@ -1,6 +1,6 @@ + xmlns="https://jakarta.ee/xml/ns/jakartaee" version="2.0"> diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index bdda33889..5d9bb1a57 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,36 +1,38 @@ - + java:app/jdbc/CargoTrackerDatabase - + - + - + - + + + + diff --git a/src/main/resources/auth0.properties b/src/main/resources/auth0.properties deleted file mode 100644 index 5412e8a3d..000000000 --- a/src/main/resources/auth0.properties +++ /dev/null @@ -1,5 +0,0 @@ -# Auth0 -domain=dev-due1wofp.us.auth0.com -clientId=XDPSlO2ltJrQZcbtLKIuksLqgCUZmhiH -clientSecret=o7qkMDCsivignvvziwgmpbRELX_OWldNRHLmpDNjK0yIu_9Qula0ZUQlEwEEQkZA -scope=openid profile email diff --git a/src/main/webapp/WEB-INF/beans.xml b/src/main/webapp/WEB-INF/beans.xml index ad0791e51..fcc23adad 100644 --- a/src/main/webapp/WEB-INF/beans.xml +++ b/src/main/webapp/WEB-INF/beans.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/faces-config.xml b/src/main/webapp/WEB-INF/faces-config.xml index 3b0ddc226..5f584bf0b 100644 --- a/src/main/webapp/WEB-INF/faces-config.xml +++ b/src/main/webapp/WEB-INF/faces-config.xml @@ -1,6 +1,7 @@ - + + diff --git a/src/main/webapp/WEB-INF/layout/admin-nav.xhtml b/src/main/webapp/WEB-INF/layout/admin-nav.xhtml index c7b57a62c..e597dee7f 100644 --- a/src/main/webapp/WEB-INF/layout/admin-nav.xhtml +++ b/src/main/webapp/WEB-INF/layout/admin-nav.xhtml @@ -1,6 +1,6 @@ + xmlns:ui="jakarta.faces.facelets" + xmlns:h="jakarta.faces.html">