Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: anasabuhussein/java-design-patterns
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: iluwatar/java-design-patterns
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 15, 2025

  1. feat: Implemented Monolithic Architecture according to the guidelines…

    … provided by issue iluwatar#2664 (iluwatar#3111)
    
    * added a pom.xml file for the monolithic structure, set up MVC file structure, and added basic model files using H2 database since its light and efficient
    
    * added a pom.xml file for the monolithic structure, set up MVC file structure, and added basic model files using H2 database since its light and efficient
    
    * Added "controllers" and repository classes to communicate with database to maintain code cleanliness
    
    * added application.properties file for springboot, added controller classes and used the CLI main class from the previous submission and enhanced upon it
    
    * fixed checkstyle comments
    
    * fixed testing class
    
    * automatically generated puml
    
    * Readme File
    
    Added Detailed Readme File in the md format
    
    * attempting to fix some debugging issues
    
    added more test cases, and tried to fix pom.xml
    
    * dropped change
    
    * another attempted fix
    
    * added more test cases
    
    * Fixes
    
    Renamed the main module/directory. Added more content to the readme.md file. fixed the orElseThrow statements
    
    Fixes
    
    Renamed the main module/directory. Added more content to the readme.md file. fixed the orElseThrow statements
    
    * fixed naming and readme file
    
    ---------
    
    Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
    MohanedAtef238 and iluwatar authored Feb 15, 2025
    Copy the full SHA
    a25b6a0 View commit details
  2. docs: add MohanedAtef238 as a contributor for code (iluwatar#3187)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Feb 15, 2025
    Copy the full SHA
    39e4d6a View commit details

Commits on Feb 16, 2025

  1. build(deps): bump org.apache.maven.plugins:maven-surefire-plugin (ilu…

    …watar#3085)
    
    Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.1 to 3.5.2.
    - [Release notes](https://github.com/apache/maven-surefire/releases)
    - [Commits](apache/maven-surefire@surefire-3.5.1...surefire-3.5.2)
    
    ---
    updated-dependencies:
    - dependency-name: org.apache.maven.plugins:maven-surefire-plugin
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 16, 2025
    Copy the full SHA
    be08156 View commit details
  2. fix: typos in documentation files (iluwatar#3186)

    * Update CannotSubtractException.java
    
    * Update CachingTest.java
    
    * Update App.java
    
    * Update caching.urm.puml
    
    * Update update-method.urm.puml
    maximevtush authored Feb 16, 2025
    Copy the full SHA
    2e7eef1 View commit details
  3. docs: add maximevtush as a contributor for code (iluwatar#3188)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Feb 16, 2025
    Copy the full SHA
    fb92682 View commit details

Commits on Feb 18, 2025

  1. build(deps-dev): bump org.testng:testng from 7.7.1 to 7.11.0 (iluwata…

    …r#3190)
    
    Bumps [org.testng:testng](https://github.com/testng-team/testng) from 7.7.1 to 7.11.0.
    - [Release notes](https://github.com/testng-team/testng/releases)
    - [Changelog](https://github.com/testng-team/testng/blob/master/CHANGES.txt)
    - [Commits](testng-team/testng@7.7.1...7.11.0)
    
    ---
    updated-dependencies:
    - dependency-name: org.testng:testng
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 18, 2025
    Copy the full SHA
    e17f138 View commit details

Commits on Feb 22, 2025

  1. feat: Added Map Reduce Design Pattern (iluwatar#3184)

    * MapReduce design pattern added
    
    * Updated README.md
    
    * added module to parent pom
    hvgh88 authored Feb 22, 2025
    Copy the full SHA
    6785b53 View commit details
  2. docs: add hvgh88 as a contributor for code (iluwatar#3191)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Feb 22, 2025
    Copy the full SHA
    851ebba View commit details

Commits on Feb 23, 2025

  1. Copy the full SHA
    1f44a8c View commit details
  2. docs: update cqrs docs

    iluwatar committed Feb 23, 2025
    Copy the full SHA
    4e16d4b View commit details
  3. Copy the full SHA
    2e40cc0 View commit details

Commits on Feb 28, 2025

  1. Copy the full SHA
    f3c4a83 View commit details
  2. build(deps): bump org.assertj:assertj-core from 3.24.2 to 3.27.3 (ilu…

    …watar#3194)
    
    Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.24.2 to 3.27.3.
    - [Release notes](https://github.com/assertj/assertj/releases)
    - [Commits](assertj/assertj@assertj-build-3.24.2...assertj-build-3.27.3)
    
    ---
    updated-dependencies:
    - dependency-name: org.assertj:assertj-core
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 28, 2025
    Copy the full SHA
    609bf8e View commit details
  3. Copy the full SHA
    a10c392 View commit details

Commits on Mar 1, 2025

  1. Copy the full SHA
    546c7ec View commit details
  2. Copy the full SHA
    eee7575 View commit details

Commits on Mar 2, 2025

  1. Copy the full SHA
    d0701d6 View commit details

Commits on Mar 3, 2025

  1. Copy the full SHA
    d78337e View commit details

Commits on Mar 4, 2025

  1. build(deps): bump org.slf4j:slf4j-api from 2.0.16 to 2.0.17 (iluwatar…

    …#3198)
    
    Bumps org.slf4j:slf4j-api from 2.0.16 to 2.0.17.
    
    ---
    updated-dependencies:
    - dependency-name: org.slf4j:slf4j-api
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 4, 2025
    Copy the full SHA
    e24739c View commit details
  2. Copy the full SHA
    3034732 View commit details
  3. Copy the full SHA
    b993805 View commit details

Commits on Mar 5, 2025

  1. Copy the full SHA
    d36eeec View commit details

Commits on Mar 6, 2025

  1. Copy the full SHA
    4a96f2d View commit details

Commits on Mar 7, 2025

  1. Copy the full SHA
    511f008 View commit details

Commits on Mar 9, 2025

  1. Copy the full SHA
    0904e2d View commit details
  2. Copy the full SHA
    74f5fdf View commit details
  3. Copy the full SHA
    8a2c779 View commit details

Commits on Mar 11, 2025

  1. Copy the full SHA
    fbde009 View commit details
  2. Copy the full SHA
    1726749 View commit details

Commits on Mar 18, 2025

  1. Copy the full SHA
    457858c View commit details
  2. docs: add smile-ab as a contributor for translation (iluwatar#3208)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 18, 2025
    Copy the full SHA
    e403df8 View commit details
  3. feat: Fix Singleton typo and extend reflection handling to remaining …

    …implementations (iluwatar#3203)
    
    * fix typo
    
    * adding Reflection handling to other Singleton implementations
    smile-ab authored Mar 18, 2025
    Copy the full SHA
    19d9d31 View commit details
  4. docs: add smile-ab as a contributor for code (iluwatar#3209)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 18, 2025
    Copy the full SHA
    29d1e30 View commit details
  5. build(deps): bump org.projectlombok:lombok from 1.18.24 to 1.18.36 (i…

    …luwatar#3205)
    
    Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.24 to 1.18.36.
    - [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown)
    - [Commits](projectlombok/lombok@v1.18.24...v1.18.36)
    
    ---
    updated-dependencies:
    - dependency-name: org.projectlombok:lombok
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 18, 2025
    Copy the full SHA
    845a428 View commit details
  6. Copy the full SHA
    66768fc View commit details
  7. docs: add Francisco-G-P as a contributor for translation (iluwatar#3210)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 18, 2025
    Copy the full SHA
    8164b97 View commit details
  8. Copy the full SHA
    a89cf98 View commit details
  9. docs: add Duartegdm as a contributor for doc (iluwatar#3211)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 18, 2025
    Copy the full SHA
    0b1933e View commit details
  10. fix: Set locale in tests to be able to run locally. Remove logging de…

    …pendency fixed versions in parent pom.xml to prevent conflicts with spring boot. Update license headers. Update urm diagrams.
    iluwatar committed Mar 18, 2025
    Copy the full SHA
    dd8b9b3 View commit details
  11. fix: add missing property

    iluwatar committed Mar 18, 2025
    Copy the full SHA
    894ae8f View commit details

Commits on Mar 23, 2025

  1. translation: German Translation for abstract-document and improved Ma…

    …in README (iluwatar#3214)
    
    * improve german translation. See iluwatar#2275
    
    * add german (de) abstract-document. See iluwatar#2275
    DenizAltunkapan authored Mar 23, 2025
    Copy the full SHA
    baf2efa View commit details
  2. docs: add DenizAltunkapan as a contributor for translation (iluwatar#…

    …3216)
    
    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 23, 2025
    Copy the full SHA
    abfb137 View commit details
  3. feat: Add Service Stub Pattern using Sentiment Analysis example (iluw…

    …atar#3215)
    
    * Add Service Stub Pattern using Sentiment Analysis example
    
    * Fix Checkstyle issues
    
    * Suppress Sonar warning for Random usage in RealSentimentAnalysisServer
    johnklint81 authored Mar 23, 2025
    Copy the full SHA
    adf5b62 View commit details
  4. docs: add johnklint81 as a contributor for code (iluwatar#3217)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 23, 2025
    Copy the full SHA
    02ae009 View commit details
  5. Copy the full SHA
    770a85e View commit details
  6. Copy the full SHA
    7effd99 View commit details
  7. Copy the full SHA
    0f19b47 View commit details

Commits on Mar 24, 2025

  1. Copy the full SHA
    3dc27b2 View commit details
  2. Copy the full SHA
    324dad5 View commit details

Commits on Mar 25, 2025

  1. build(deps): bump jakarta.persistence:jakarta.persistence-api (iluwat…

    …ar#3218)
    
    Bumps [jakarta.persistence:jakarta.persistence-api](https://github.com/jakartaee/persistence) from 3.1.0 to 3.2.0.
    - [Release notes](https://github.com/jakartaee/persistence/releases)
    - [Commits](jakartaee/persistence@3.1-3.1.0-RELEASE...3.2-3.2.0-RELEASE)
    
    ---
    updated-dependencies:
    - dependency-name: jakarta.persistence:jakarta.persistence-api
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 25, 2025
    Copy the full SHA
    3a5553b View commit details
Showing 2,331 changed files with 26,853 additions and 18,672 deletions.
137 changes: 137 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -3393,6 +3393,143 @@
"contributions": [
"code"
]
},
{
"login": "MohanedAtef238",
"name": "Mohaned Atef",
"avatar_url": "https://avatars.githubusercontent.com/u/105852138?v=4",
"profile": "https://github.com/MohanedAtef238",
"contributions": [
"code"
]
},
{
"login": "maximevtush",
"name": "Maxim Evtush",
"avatar_url": "https://avatars.githubusercontent.com/u/154841002?v=4",
"profile": "https://github.com/maximevtush",
"contributions": [
"code"
]
},
{
"login": "hvgh88",
"name": "Harshita Vidapanakal",
"avatar_url": "https://avatars.githubusercontent.com/u/65297242?v=4",
"profile": "https://github.com/hvgh88",
"contributions": [
"code"
]
},
{
"login": "smile-ab",
"name": "smile-ab",
"avatar_url": "https://avatars.githubusercontent.com/u/202159894?v=4",
"profile": "https://github.com/smile-ab",
"contributions": [
"translation",
"code"
]
},
{
"login": "Francisco-G-P",
"name": "Francisco-G-P",
"avatar_url": "https://avatars.githubusercontent.com/u/186766789?v=4",
"profile": "https://github.com/Francisco-G-P",
"contributions": [
"translation"
]
},
{
"login": "Duartegdm",
"name": "Gabriel Duarte",
"avatar_url": "https://avatars.githubusercontent.com/u/137895372?v=4",
"profile": "https://github.com/Duartegdm",
"contributions": [
"doc"
]
},
{
"login": "DenizAltunkapan",
"name": "Deniz Altunkapan",
"avatar_url": "https://avatars.githubusercontent.com/u/93663085?v=4",
"profile": "https://github.com/DenizAltunkapan",
"contributions": [
"translation"
]
},
{
"login": "johnklint81",
"name": "John Klint",
"avatar_url": "https://avatars.githubusercontent.com/u/70539458?v=4",
"profile": "https://github.com/johnklint81",
"contributions": [
"code"
]
},
{
"login": "sanurah",
"name": "Sanura Hettiarachchi",
"avatar_url": "https://avatars.githubusercontent.com/u/16178588?v=4",
"profile": "https://github.com/sanurah",
"contributions": [
"code"
]
},
{
"login": "2897robo",
"name": "Kim Gi Uk",
"avatar_url": "https://avatars.githubusercontent.com/u/31699375?v=4",
"profile": "https://github.com/2897robo",
"contributions": [
"code"
]
},
{
"login": "Suchismita-Deb",
"name": "Suchismita Deb",
"avatar_url": "https://avatars.githubusercontent.com/u/68535074?v=4",
"profile": "https://github.com/Suchismita-Deb",
"contributions": [
"code"
]
},
{
"login": "ssrijan-007-sys",
"name": "ssrijan-007-sys",
"avatar_url": "https://avatars.githubusercontent.com/u/137605821?v=4",
"profile": "https://github.com/ssrijan-007-sys",
"contributions": [
"code"
]
},
{
"login": "e5LA",
"name": "e5LA",
"avatar_url": "https://avatars.githubusercontent.com/u/208197507?v=4",
"profile": "https://github.com/e5LA",
"contributions": [
"code",
"doc"
]
},
{
"login": "maziyar-gerami",
"name": "Maziyar Gerami",
"avatar_url": "https://avatars.githubusercontent.com/u/122622721?v=4",
"profile": "http://maziyar-gerami.github.io/portfolio/",
"contributions": [
"translation"
]
},
{
"login": "yybmion",
"name": "yoobin_mion",
"avatar_url": "https://avatars.githubusercontent.com/u/113106136?v=4",
"profile": "https://github.com/yybmion",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 6,
111 changes: 41 additions & 70 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
#
# The MIT License
# Copyright © 2014-2021 Ilkka Seppälä
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

# We are using two jobs here for testing our code on the latest JDK 11 build as well as a more satble build version of 11.0.3
# You can see the full discussion here https://github.com/iluwatar/java-design-patterns/pull/1868#issue-1029459688

name: Java CI

on:
@@ -37,46 +8,46 @@ jobs:

build-and-analyze:

name: Build and Run Sonar analysis on JDK 17
runs-on: ubuntu-20.04
name: Build and Run Sonar analysis on JDK 21
runs-on: ubuntu-22.04
steps:

- name: Checkout Code
uses: actions/checkout@v4
with:
# Disabling shallow clone for improving relevancy of SonarQube reporting
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Cache Sonar packages which as used to run analysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb

- name: Build with Maven and run SonarQube analysis
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Checkout Code
uses: actions/checkout@v4
with:
# Disabling shallow clone for improving relevancy of SonarQube reporting
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Cache Sonar packages which are used to run analysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb

- name: Build with Maven and run SonarQube analysis
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
110 changes: 42 additions & 68 deletions .github/workflows/maven-pr-builder.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
#
# The MIT License
# Copyright © 2014-2021 Ilkka Seppälä
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java PR Builder

on:
@@ -37,47 +11,47 @@ permissions:
jobs:
build-and-analyze:

name: Build on JDK 17
runs-on: ubuntu-20.04
name: Build on JDK 21
runs-on: ubuntu-22.04
steps:

- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Cache Sonar packages which as used to run analysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb

- name: Build with Maven and run SonarQube analysis
env:
# Intermediate variable
HEAD_REF: ${{ github.head_ref }}
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.pullrequest.branch=$HEAD_REF -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Cache Sonar packages which are used to run analysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb

- name: Build with Maven and run SonarQube analysis
env:
# Intermediate variable
HEAD_REF: ${{ github.head_ref }}
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.pullrequest.branch=$HEAD_REF -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
Loading