From b8e878bde16da781c96dbb804c9e93623d1f5aa0 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:44:05 +0530 Subject: [PATCH 001/121] Create build.yml --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..86dfc89 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: + - main + + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' From 6a33a96a37603685eeba3aa938290323b760f9b2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:54:46 +0530 Subject: [PATCH 002/121] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86dfc89..24a5e17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build on: push: branches: - - main + - master jobs: From 0d28e30ad727ce6de3c389ff00d8f5fcd04e2307 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:16:49 +0530 Subject: [PATCH 003/121] Update build.yml --- .github/workflows/build.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24a5e17..0b606f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,36 +3,24 @@ name: Build on: push: branches: - - master + - main jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze + - uses: sonarsource/sonarqube-scan-action@master env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' + # If you wish to fail your job when the Quality Gate is red, uncomment the + # following lines. This would typically be used to fail a deployment. + # - uses: sonarsource/sonarqube-quality-gate-action@master + # timeout-minutes: 5 + # env: + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 223e83b4c0abeb538fb09eaf967ee578211adf07 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:17:46 +0530 Subject: [PATCH 004/121] Create sonar-project.properties --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..decd5e9 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=bhushan From 71e328ae7c06ca9abe1996030663cdac4204b759 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:28:08 +0530 Subject: [PATCH 005/121] Update build.yml --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b606f7..3becdee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} # If you wish to fail your job when the Quality Gate is red, uncomment the # following lines. This would typically be used to fail a deployment. - # - uses: sonarsource/sonarqube-quality-gate-action@master - # timeout-minutes: 5 - # env: - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - uses: sonarsource/sonarqube-quality-gate-action@master + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From e644ec564c127d70c89f613537e89f0bcb0a32f9 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:29:59 +0530 Subject: [PATCH 006/121] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3becdee..f5ebfb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,6 @@ jobs: # If you wish to fail your job when the Quality Gate is red, uncomment the # following lines. This would typically be used to fail a deployment. - uses: sonarsource/sonarqube-quality-gate-action@master - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 2f932bce4cb0704482783fccaa2d8deca143570b Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:33:24 +0530 Subject: [PATCH 007/121] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5ebfb7..a7a4d19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} # If you wish to fail your job when the Quality Gate is red, uncomment the - # following lines. This would typically be used to fail a deployment. + # following lines. This would typically be used to fail a deployment - uses: sonarsource/sonarqube-quality-gate-action@master timeout-minutes: 5 env: From 3d47e4e69e25c83095a50e43878592c804c173af Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:40:40 +0530 Subject: [PATCH 008/121] Update build.yml --- .github/workflows/build.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7a4d19..86dfc89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,18 +9,30 @@ on: jobs: build: name: Build - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - uses: sonarsource/sonarqube-scan-action@master + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # If you wish to fail your job when the Quality Gate is red, uncomment the - # following lines. This would typically be used to fail a deployment - - uses: sonarsource/sonarqube-quality-gate-action@master - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' From 53b3f3b3f8dad4c0e1e760f2c6fc65107fe33575 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:43:11 +0530 Subject: [PATCH 009/121] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86dfc89..6f3b888 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 with: From 0d4214de2eb58b56fce9043151010e471194a444 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:47:15 +0530 Subject: [PATCH 010/121] Create build.gradle --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 build.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..4798697 --- /dev/null +++ b/build.gradle @@ -0,0 +1,10 @@ +plugins { + id "org.sonarqube" version "4.2.1.3168" +} + +sonar { + properties { + property "sonar.projectKey", "bhushan" + property "sonar.projectName", "bhushan" + } +} From 047e90e87115f542657421c0dafb87261cfb2569 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:48:02 +0530 Subject: [PATCH 011/121] Update build.yml --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f3b888..d50dfad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -24,15 +24,15 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages + - name: Cache Gradle packages uses: actions/cache@v1 with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' + run: ./gradlew build sonar --info From c7077d8b0845a4a1f043d40a104d93b4c9ac6653 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:51:01 +0530 Subject: [PATCH 012/121] Create HotelReservationTest.java --- src/test/java/HotelReservationTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/java/HotelReservationTest.java diff --git a/src/test/java/HotelReservationTest.java b/src/test/java/HotelReservationTest.java new file mode 100644 index 0000000..8e409a2 --- /dev/null +++ b/src/test/java/HotelReservationTest.java @@ -0,0 +1,20 @@ +import org.junit.Test; + +import static org.junit.Assert.*; + +public class HotelReservationTest { + + @Test + public void testReservationSuccess() { + HotelReservation reservation = new HotelReservation(); + boolean isSuccess = reservation.makeReservation("John", 3); + assertTrue(isSuccess); + } + + @Test + public void testReservationFailure() { + HotelReservation reservation = new HotelReservation(); + boolean isSuccess = reservation.makeReservation("Jane", 10); + assertFalse(isSuccess); + } +} From 081054b98051ee2983aaa7af403894b939b27ec8 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:53:57 +0530 Subject: [PATCH 013/121] Update sonar-project.properties --- sonar-project.properties | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index decd5e9..60ffcc0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1 +1,11 @@ -sonar.projectKey=bhushan +sonar.projectKey=hotel-management +sonar.projectName=Hotel Management System +sonar.projectVersion=1.0 + +sonar.sources=src +sonar.tests=test +sonar.java.binaries=target/classes +sonar.java.test.binaries=target/test-classes + +sonar.host.url=http://localhost:9000/ +sonar.login=squ_8ec7564183ddcd5ff197bdf2b4c101e07d4ac7be From 28836005e2b0ccb4be2aa350241880df3bcb35b5 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:58:05 +0530 Subject: [PATCH 014/121] Update build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d50dfad..a5b6674 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 with: @@ -32,7 +32,6 @@ jobs: restore-keys: ${{ runner.os }}-gradle - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: ./gradlew build sonar --info From db614c6d603a5e9918420f52dac39b9aadb26959 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:34:08 +0530 Subject: [PATCH 015/121] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5b6674..93d7af8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build on: push: branches: - - main + - master jobs: From a32862b0463bb58d6764e59867ad6ce45dd97829 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:41:45 +0530 Subject: [PATCH 016/121] Update build.yml --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93d7af8..86dfc89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,13 +3,13 @@ name: Build on: push: branches: - - master + - main jobs: build: name: Build - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -24,14 +24,15 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages + - name: Cache Maven packages uses: actions/cache@v1 with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 - name: Build and analyze env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: ./gradlew build sonar --info + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' From 19b0e40d7a0a3245daf9c8d7fd2483bb2e36ae08 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:43:56 +0530 Subject: [PATCH 017/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 60ffcc0..d1e3c35 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -8,4 +8,4 @@ sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes sonar.host.url=http://localhost:9000/ -sonar.login=squ_8ec7564183ddcd5ff197bdf2b4c101e07d4ac7be +sonar.login=sqp_6211b2a9e06dab2152093163db57434ccde1ae77 From 413283968c3d834fa4636adaf6a190973be8061b Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:47:12 +0530 Subject: [PATCH 018/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index d1e3c35..ff0101f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=hotel-management -sonar.projectName=Hotel Management System +sonar.projectKey=bhushan +sonar.projectName=bhushan sonar.projectVersion=1.0 sonar.sources=src From 98093fba41fc49176e63cec1f556f3d7b61dadc2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:34:04 +0530 Subject: [PATCH 019/121] Create Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..eecd4df --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +node { + stage('SCM') { + checkout scm + } + stage('SonarQube Analysis') { + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + } + } +} From e3b8729e6177c4315fb788ffba7fec36e6c85011 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:35:41 +0530 Subject: [PATCH 020/121] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index eecd4df..3e6f28b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ node { } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; + withSonarQubeEnv() { sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" } From c627a2854a5623bd1712fd7bb1a147d819d4f9a1 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:38:28 +0530 Subject: [PATCH 021/121] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e6f28b..eecd4df 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,6 @@ node { } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; - withSonarQubeEnv() { sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" } From 5cf5a6d06fdb12fe082d72bc14b9d7438bb6663f Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:27:34 +0530 Subject: [PATCH 022/121] Update Jenkinsfile From 0839481a983bedb363b87802a46364727cdb9956 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:30:02 +0530 Subject: [PATCH 023/121] Update Jenkinsfile From 3bbab82835e925af352c37bb75fa2834e5600c6d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:35:32 +0530 Subject: [PATCH 024/121] Update Jenkinsfile --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eecd4df..5eae530 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,12 @@ node { checkout scm } stage('SonarQube Analysis') { - def mvn = tool 'Default Maven'; - withSonarQubeEnv() { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + def mvnHome = tool 'Default Maven'; + def maven = bat(script: "\"${mvnHome}\\bin\\mvn.bat\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'", returnStatus: true) + + if (maven != 0) { + currentBuild.result = 'FAILURE' + error("Maven build and SonarQube analysis failed") } } } From 910394bc56d4b0057e6cddc47ae3d4018186f117 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:39:07 +0530 Subject: [PATCH 025/121] Update Jenkinsfile --- Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5eae530..b372c73 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,11 +3,10 @@ node { checkout scm } stage('SonarQube Analysis') { - def mvnHome = tool 'Default Maven'; - def maven = bat(script: "\"${mvnHome}\\bin\\mvn.bat\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'", returnStatus: true) + def maven = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' + bat "\"${maven}/bin/mvn.bat\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" - if (maven != 0) { - currentBuild.result = 'FAILURE' + if (currentBuild.resultIsWorseOrEqualTo('FAILURE')) { error("Maven build and SonarQube analysis failed") } } From c0151eb4ee7aff234253ffd47ce12057ff8342d8 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:17:27 +0530 Subject: [PATCH 026/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b372c73..27f87ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ node { } stage('SonarQube Analysis') { def maven = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' - bat "\"${maven}/bin/mvn.bat\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + bat "\"${maven}/bin/mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" if (currentBuild.resultIsWorseOrEqualTo('FAILURE')) { error("Maven build and SonarQube analysis failed") From 6bb1b106cde55ccc7687dfadb33601559255ff32 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:20:21 +0530 Subject: [PATCH 027/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 27f87ac..da9f8b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ node { } stage('SonarQube Analysis') { def maven = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' - bat "\"${maven}/bin/mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + bat "\"${maven}\bin\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" if (currentBuild.resultIsWorseOrEqualTo('FAILURE')) { error("Maven build and SonarQube analysis failed") From 151110dbd8d462ec0e2f1e773486de4d0660a934 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:23:02 +0530 Subject: [PATCH 028/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index da9f8b2..f4480d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ node { } stage('SonarQube Analysis') { def maven = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' - bat "\"${maven}\bin\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + bat "\"${maven}\\bin\\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" if (currentBuild.resultIsWorseOrEqualTo('FAILURE')) { error("Maven build and SonarQube analysis failed") From 8a6cc59343a8228086ede4806eabb1d1a743aa20 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:29:05 +0530 Subject: [PATCH 029/121] Create pom.xml --- pom.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pom.xml @@ -0,0 +1 @@ + From 1332b5b7da1482e703082b842465ac907ec9ad53 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:31:41 +0530 Subject: [PATCH 030/121] Update Jenkinsfile --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4480d5..eecd4df 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,11 +3,9 @@ node { checkout scm } stage('SonarQube Analysis') { - def maven = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' - bat "\"${maven}\\bin\\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" - - if (currentBuild.resultIsWorseOrEqualTo('FAILURE')) { - error("Maven build and SonarQube analysis failed") + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" } } } From 07adb3304a2c951133810874845e102a1c72203c Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:33:23 +0530 Subject: [PATCH 031/121] Update Jenkinsfile --- Jenkinsfile | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eecd4df..1787b2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,24 @@ -node { - stage('SCM') { - checkout scm - } - stage('SonarQube Analysis') { - def mvn = tool 'Default Maven'; - withSonarQubeEnv() { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" +pipeline { + agent { + label 'windows' // Specify a Windows agent label + } + stages { + stage('SCM') { + steps { + checkout scm + } + } + stage('SonarQube Analysis') { + steps { + script { + def mavenHome = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' + bat "\"${mavenHome}\\bin\\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + error("Maven build and SonarQube analysis failed") + } + } + } } - } } + From a24cef7d4a44b7cb370a10bf143711638cbe110d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:15:50 +0530 Subject: [PATCH 032/121] Update Jenkinsfile --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1787b2e..234fb24 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,5 @@ pipeline { - agent { - label 'windows' // Specify a Windows agent label - } + agent any stages { stage('SCM') { steps { From 9d6df64d57a23123e9da07e45f0237160f81bea2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:35:03 +0530 Subject: [PATCH 033/121] Update Jenkinsfile --- Jenkinsfile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 234fb24..9c7df33 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,19 +1,28 @@ pipeline { agent any stages { - stage('SCM') { + stage('Checkout') { steps { + // Checkout your code from Git checkout scm } } + stage('Build') { + steps { + // Build your project + sh 'mvn clean install' + } + } stage('SonarQube Analysis') { steps { - script { - def mavenHome = tool name: 'Default Maven', type: 'hudson.tasks.Maven$MavenInstallation' - bat "\"${mavenHome}\\bin\\mvn.cmd\" clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" - } - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - error("Maven build and SonarQube analysis failed") + // Configure SonarQube environment + withSonarQubeEnv('My SonarQube Server') { + // Run SonarQube analysis + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + } + sh 'mvn sonar:sonar' } } } From 364933eb7aa07dc24f8afab8d87411420aa97e46 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:37:48 +0530 Subject: [PATCH 034/121] Update Jenkinsfile --- Jenkinsfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9c7df33..d22d118 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,14 +18,10 @@ pipeline { // Configure SonarQube environment withSonarQubeEnv('My SonarQube Server') { // Run SonarQube analysis - def mvn = tool 'Default Maven'; - withSonarQubeEnv() { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" - } - sh 'mvn sonar:sonar' + def mvnHome = tool name: 'Maven', type: 'Tool' + sh "${mvnHome}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" } } } } } - From 95fb13d92e0932c25f37f279fb657f02d9cd30ad Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:38:57 +0530 Subject: [PATCH 035/121] Update Jenkinsfile --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d22d118..03a8fed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,9 @@ pipeline { agent any + tools { + // Define the tool name and type (e.g., Maven) + maven 'Maven' + } stages { stage('Checkout') { steps { @@ -18,8 +22,7 @@ pipeline { // Configure SonarQube environment withSonarQubeEnv('My SonarQube Server') { // Run SonarQube analysis - def mvnHome = tool name: 'Maven', type: 'Tool' - sh "${mvnHome}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan'" + sh 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName="bhushan"' } } } From 5c16deb49172480252081877a1af2784e87a2291 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:41:35 +0530 Subject: [PATCH 036/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 03a8fed..3ab888d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools { // Define the tool name and type (e.g., Maven) - maven 'Maven' + maven 'Default Maven' } stages { stage('Checkout') { From 6a93bce61cde60c19d66c0a0dd2493b5414c5666 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:45:39 +0530 Subject: [PATCH 037/121] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ab888d..b695228 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { stage('Build') { steps { // Build your project - sh 'mvn clean install' + bat 'mvn clean install' } } stage('SonarQube Analysis') { @@ -22,7 +22,7 @@ pipeline { // Configure SonarQube environment withSonarQubeEnv('My SonarQube Server') { // Run SonarQube analysis - sh 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName="bhushan"' + bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName="bhushan"' } } } From ba3abcf085ea93e6f5b053fb68e67f1bff04dcad Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:02:43 +0530 Subject: [PATCH 038/121] Update Jenkinsfile --- Jenkinsfile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b695228..569df2b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,28 +1,24 @@ pipeline { agent any - tools { - // Define the tool name and type (e.g., Maven) - maven 'Default Maven' - } + stages { stage('Checkout') { steps { - // Checkout your code from Git checkout scm } } - stage('Build') { - steps { - // Build your project - bat 'mvn clean install' - } - } + stage('SonarQube Analysis') { + environment { + scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + } steps { - // Configure SonarQube environment - withSonarQubeEnv('My SonarQube Server') { - // Run SonarQube analysis - bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName="bhushan"' + script { + def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + withSonarQubeEnv('bhushan') { + bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat -X" + + } } } } From 3f564911459e6b8a7ac6034f5e8d9b841812ae98 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:05:33 +0530 Subject: [PATCH 039/121] Update sonar-project.properties --- sonar-project.properties | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index ff0101f..330fd39 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,6 @@ -sonar.projectKey=bhushan -sonar.projectName=bhushan +# Project identification +sonar.projectKey=java2 +sonar.projectName=java2 sonar.projectVersion=1.0 sonar.sources=src @@ -8,4 +9,6 @@ sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes sonar.host.url=http://localhost:9000/ -sonar.login=sqp_6211b2a9e06dab2152093163db57434ccde1ae77 +sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c +sonar.sourceEncoding=UTF-8 + From c6d5f8f247e2d466ab0d8fd83921d46015d80f8d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:11:49 +0530 Subject: [PATCH 040/121] Update sonar-project.properties --- sonar-project.properties | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 330fd39..11dc8bc 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,7 @@ +sonar.host.url=http://localhost:9000/ +sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c +sonar.sourceEncoding=UTF-8 + # Project identification sonar.projectKey=java2 sonar.projectName=java2 @@ -8,7 +12,5 @@ sonar.tests=test sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes -sonar.host.url=http://localhost:9000/ -sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c -sonar.sourceEncoding=UTF-8 + From 7bc52f0b5ba8ea2d9aebfa8b6d45f643187df2aa Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:14:34 +0530 Subject: [PATCH 041/121] Update sonar-project.properties --- sonar-project.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 11dc8bc..7c5537c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,9 @@ sonar.host.url=http://localhost:9000/ -sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c + sonar.sourceEncoding=UTF-8 +sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c + # Project identification sonar.projectKey=java2 sonar.projectName=java2 From da9742b09c39d05bd0ff26bcf88b5e0cc09bf6c7 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:15:30 +0530 Subject: [PATCH 042/121] Update sonar-project.properties --- sonar-project.properties | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 7c5537c..203ec25 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,10 +9,3 @@ sonar.projectKey=java2 sonar.projectName=java2 sonar.projectVersion=1.0 -sonar.sources=src -sonar.tests=test -sonar.java.binaries=target/classes -sonar.java.test.binaries=target/test-classes - - - From 48c7f73f1cc273d1a9b459ca94929533446167a6 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:19:11 +0530 Subject: [PATCH 043/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 203ec25..cac097f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,7 @@ +#----- Default SonarQube server sonar.host.url=http://localhost:9000/ +#----- Default source code encoding sonar.sourceEncoding=UTF-8 sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c @@ -8,4 +10,3 @@ sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c sonar.projectKey=java2 sonar.projectName=java2 sonar.projectVersion=1.0 - From 1f08d1438c5251a3d63d6c0fb7ca6c0c2787673b Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:30:34 +0530 Subject: [PATCH 044/121] Update build.gradle --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 4798697..7cad14e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { sonar { properties { - property "sonar.projectKey", "bhushan" - property "sonar.projectName", "bhushan" + property "sonar.projectKey", "java2" + property "sonar.projectName", "java2" } } From b96d74fa35dc9b55d23ab54e6dbc3f696ced2d08 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:46:02 +0530 Subject: [PATCH 045/121] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86dfc89..b9374e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,4 +35,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName='bhushan' + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=java2 -Dsonar.projectName='java2' From 2b6e6a98795eb773b894c24d27b4ed4f53472536 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:01:30 +0530 Subject: [PATCH 046/121] Update sonar-project.properties --- sonar-project.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index cac097f..d6ad7fd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,3 +10,8 @@ sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c sonar.projectKey=java2 sonar.projectName=java2 sonar.projectVersion=1.0 + +sonar.exclusions=**/*.java +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/ +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath From 484895545f95e57d6cce6a932f33d17ed5816f13 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:19:01 +0530 Subject: [PATCH 047/121] Update sonar-project.properties --- sonar-project.properties | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index d6ad7fd..a47c55f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,6 +12,5 @@ sonar.projectName=java2 sonar.projectVersion=1.0 sonar.exclusions=**/*.java -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/ -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ + sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath From ae85b15234e3b03552a3a1a960bfab6ecc087a46 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:27:11 +0530 Subject: [PATCH 048/121] Update sonar-project.properties --- sonar-project.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index a47c55f..fd4a376 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,4 +13,3 @@ sonar.projectVersion=1.0 sonar.exclusions=**/*.java -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath From 427671073e0e420618ee25ee63fc3c16388faa6e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:39:36 +0530 Subject: [PATCH 049/121] Delete pom.xml --- pom.xml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 pom.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 8b13789..0000000 --- a/pom.xml +++ /dev/null @@ -1 +0,0 @@ - From f5e131344f6436d1c36262591a56d947fa3503a7 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:41:09 +0530 Subject: [PATCH 050/121] Delete src directory --- src/test/java/HotelReservationTest.java | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/test/java/HotelReservationTest.java diff --git a/src/test/java/HotelReservationTest.java b/src/test/java/HotelReservationTest.java deleted file mode 100644 index 8e409a2..0000000 --- a/src/test/java/HotelReservationTest.java +++ /dev/null @@ -1,20 +0,0 @@ -import org.junit.Test; - -import static org.junit.Assert.*; - -public class HotelReservationTest { - - @Test - public void testReservationSuccess() { - HotelReservation reservation = new HotelReservation(); - boolean isSuccess = reservation.makeReservation("John", 3); - assertTrue(isSuccess); - } - - @Test - public void testReservationFailure() { - HotelReservation reservation = new HotelReservation(); - boolean isSuccess = reservation.makeReservation("Jane", 10); - assertFalse(isSuccess); - } -} From f5ebd909a98c69d5200c3432b38b50fc758d74fd Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:41:29 +0530 Subject: [PATCH 051/121] Delete .github/workflows directory --- .github/workflows/build.yml | 38 ------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b9374e2..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build - -on: - push: - branches: - - main - - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=java2 -Dsonar.projectName='java2' From 0efd39d56cc6bdcd530a1d370e63a6fdbc948724 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:03:59 +0530 Subject: [PATCH 052/121] Create pom.xml --- pom.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5ea01ca --- /dev/null +++ b/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + com.example + my-project + 1.0.0 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + + +Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software +A sample Maven project +https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software + + From bd65a906704b73da6e9c1dc97c2d8776e35cfb04 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:34:29 +0530 Subject: [PATCH 053/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 569df2b..b8dce27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { script { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' withSonarQubeEnv('bhushan') { - bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat -X" + bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" } } From e894f7e319fe9a3fe66aff928d1ac7623a7c2c04 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:43:17 +0530 Subject: [PATCH 054/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index fd4a376..6dee159 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,5 +11,6 @@ sonar.projectKey=java2 sonar.projectName=java2 sonar.projectVersion=1.0 -sonar.exclusions=**/*.java + +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath From a46118e267f41aa471577c91c057dc011061491d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:44:59 +0530 Subject: [PATCH 055/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 6dee159..1cbb0c8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,5 +12,6 @@ sonar.projectName=java2 sonar.projectVersion=1.0 -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/ +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ From f31130d695dcbeb72d51b624f73117ce9482856e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:48:01 +0530 Subject: [PATCH 056/121] Update sonar-project.properties --- sonar-project.properties | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 1cbb0c8..057808a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,6 +12,5 @@ sonar.projectName=java2 sonar.projectVersion=1.0 - -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/ -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ +# Define multiple binary directories using a comma-separated list +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/,Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ From 636e03d8b812cc39dbd5db9f9e2e912c750eeaad Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:52:01 +0530 Subject: [PATCH 057/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 057808a..a69df4c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,4 +13,4 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/,Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/, Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ From b1c7f901674ee17da5c2e6b2efe1c23ea9e7df3c Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:54:40 +0530 Subject: [PATCH 058/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index a69df4c..8215cf8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,4 +13,4 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/User/, Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/Jewellery Shop System Java-Using Swing-Mysql/bin/Admin/ +sonar.java.binaries=bin/User,bin/Admin From d85255dca603a5c9f2ab7659eb7fc88f7ee1f9f0 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:56:52 +0530 Subject: [PATCH 059/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 8215cf8..8e201e4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,4 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=bin/User,bin/Admin + +sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath From 359f465bddc33a91909b9ce2a734cef8115557d0 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:58:59 +0530 Subject: [PATCH 060/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 8e201e4..486580e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,4 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software/School Management System Java-Using Swing-Mysql/.classpath +sonar.java.binaries=target/classes From 7007b652bae49b6d0b66d8f476f660bc0fc73b5d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:00:28 +0530 Subject: [PATCH 061/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 486580e..0bc5390 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,4 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=target/classes +sonar.java.binaries=./target/classes From 3b522ff01c00883611b84125cd706d24f46f43d1 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:02:32 +0530 Subject: [PATCH 062/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 0bc5390..c76306d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=./target/classes +sonar.java.binaries=./target/classes,./another/target/classes + From 0a2d0078f9cac2c665de5f02a8f6b2840c3eb947 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:05:05 +0530 Subject: [PATCH 063/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index c76306d..4abdb4d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,5 +14,6 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=./target/classes,./another/target/classes +sonar.java.binaries=./target/classes + From 37a4cb704a5d223e6948d1fef97503cafceffd09 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:09:45 +0530 Subject: [PATCH 064/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 4abdb4d..d200af9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,6 +14,6 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=./target/classes +sonar.java.binaries=**/*classes From 42537c742d6139f2ad6d9f1a2305491c9258b22a Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:10:43 +0530 Subject: [PATCH 065/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index d200af9..f0c242f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,7 +4,7 @@ sonar.host.url=http://localhost:9000/ #----- Default source code encoding sonar.sourceEncoding=UTF-8 -sonar.login=sqa_e9713d073756a25f931823cc03b187d32fbcb47c +sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c # Project identification sonar.projectKey=java2 From 34d701decf1b7e42c16ffb8cd0a2070845afda82 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:13:22 +0530 Subject: [PATCH 066/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index f0c242f..194bd0a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,6 +14,7 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=**/*classes +sonar.java.binaries=**/*.class + From 9a81113365f7e9e8c6abd0a8929077b17b354111 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:53:50 +0530 Subject: [PATCH 067/121] Update sonar-project.properties --- sonar-project.properties | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 194bd0a..3bc88fb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,10 +11,6 @@ sonar.projectKey=java2 sonar.projectName=java2 sonar.projectVersion=1.0 - # Define multiple binary directories using a comma-separated list -sonar.java.binaries=**/*.class - - - +sonar.java.binaries=target/classes From bf85d2a524ccda9601dc92f5a38391ba63d449b2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:00:21 +0530 Subject: [PATCH 068/121] Update sonar-project.properties --- sonar-project.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 3bc88fb..64c4cc8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,4 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=target/classes +sonar.java.binaries=**/*.class + From 9bc5ab2daa5a2ead592f0bf08c563c2558c912d9 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:05:47 +0530 Subject: [PATCH 069/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 64c4cc8..460ed82 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=**/*.class +sonar.sources=src From 2f214d92563491cd12a27ef6905351812090a2d0 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:15:33 +0530 Subject: [PATCH 070/121] Update Jenkinsfile --- Jenkinsfile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b8dce27..6077ed2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,37 @@ pipeline { agent any + tools { + // Make sure the name matches the one configured in Jenkins + maven 'mvn' + } + stages { - stage('Checkout') { + stage('SCM') { steps { - checkout scm + // Checkout the code from Git + checkout([$class: 'GitSCM', + branches: [[name: '*/master']], + doGenerateSubmoduleConfigurations: false, + extensions: [], + submoduleCfg: [], + userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Hotel-Management-Project-Java.git']]]) } } - + stage('SonarQube Analysis') { - environment { - scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' - } steps { - script { - def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' - withSonarQubeEnv('bhushan') { - bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" + // Set up environment variables for SonarQube + withSonarQubeEnv('bhushan') { + // Run Maven clean + bat 'mvn clean' + + // Run Maven verify + bat 'mvn verify' + + // Run SonarQube analysis + bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan'' - } } } } From cd7c695b6b10fbe0aac817f2d682498d376fdf93 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:16:39 +0530 Subject: [PATCH 071/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6077ed2..b834c31 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { bat 'mvn verify' // Run SonarQube analysis - bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan'' + bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan'\' } } From aa24bd93dcd10695bb69c5e64a8dcae1399c7b67 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:17:30 +0530 Subject: [PATCH 072/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 460ed82..6552fb6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.sources=src +sonar.exclusions=**/*.java From eab0846a48c1480f4a19c1c3d593be9f6b5a33ec Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:19:05 +0530 Subject: [PATCH 073/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 6552fb6..71e1d63 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.exclusions=**/*.java +sonar.java.binaries=**/*.java From 293acf199c6d91674ba15839707407946060b9a2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:19:43 +0530 Subject: [PATCH 074/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b834c31..b78a772 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { bat 'mvn verify' // Run SonarQube analysis - bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan'\' + bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan\'' } } From a729d594976bd55cea0454e15cf05752eef48453 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:34:08 +0530 Subject: [PATCH 075/121] Update Jenkinsfile --- Jenkinsfile | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b78a772..b8dce27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,37 +1,24 @@ pipeline { agent any - tools { - // Make sure the name matches the one configured in Jenkins - maven 'mvn' - } - stages { - stage('SCM') { + stage('Checkout') { steps { - // Checkout the code from Git - checkout([$class: 'GitSCM', - branches: [[name: '*/master']], - doGenerateSubmoduleConfigurations: false, - extensions: [], - submoduleCfg: [], - userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Hotel-Management-Project-Java.git']]]) + checkout scm } } - + stage('SonarQube Analysis') { + environment { + scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + } steps { - // Set up environment variables for SonarQube - withSonarQubeEnv('bhushan') { - // Run Maven clean - bat 'mvn clean' - - // Run Maven verify - bat 'mvn verify' - - // Run SonarQube analysis - bat 'mvn clean verify sonar:sonar -Dsonar.projectKey=bhushan -Dsonar.projectName=\'bhushan\'' + script { + def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + withSonarQubeEnv('bhushan') { + bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" + } } } } From 12499b0d9b5b5cae5ec6559ba0480660770646ac Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:39:38 +0530 Subject: [PATCH 076/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 71e1d63..a71bb87 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=**/*.java - +sonar.java.binaries=*/*.java +#sonar.exclusions=**/*.java From be3a6859aa429ea96b0ffe714ba226f9584a8c62 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:41:58 +0530 Subject: [PATCH 077/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index a71bb87..d276f1e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=*/*.java -#sonar.exclusions=**/*.java +#sonar.java.binaries=*/*.java +sonar.exclusions=**/*.java From e1ddf169a692ae4397fe86350b77a0f32665c75d Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:55:27 +0530 Subject: [PATCH 078/121] Update Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b8dce27..2294b9a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,17 @@ pipeline { stage('Checkout') { steps { checkout scm + } + } + stage('SCM') { + steps { + // Checkout the code from Git + checkout([$class: 'GitSCM', + branches: [[name: '*/main']], + doGenerateSubmoduleConfigurations: false, + extensions: [], + submoduleCfg: [], + userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software.git']]]) } } From dac5b976cd39ce181d5d2d09c4e69b99048a413f Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:57:23 +0530 Subject: [PATCH 079/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index d276f1e..b8b920c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,5 +13,5 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -#sonar.java.binaries=*/*.java -sonar.exclusions=**/*.java +#sonar.java.binaries=**/*.class +#sonar.exclusions=**/*.java From bde9e8308f014f9bc54906fb26df545b0ae3589e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:17:36 +0530 Subject: [PATCH 080/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index b8b920c..4d30c76 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,4 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list #sonar.java.binaries=**/*.class -#sonar.exclusions=**/*.java +sonar.exclusions=**/*.java From 23955c3ad93e42cc6525c0aac2bdfe415186b498 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:31:38 +0530 Subject: [PATCH 081/121] Update sonar-project.properties --- sonar-project.properties | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 4d30c76..3ace55f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,8 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list #sonar.java.binaries=**/*.class -sonar.exclusions=**/*.java +#sonar.exclusions=**/*.java +sonar.sources=src +sonar.tests=test +sonar.java.binaries=target/classes +sonar.java.test.binaries=target/test-classes From 15c38f091cf13e95208aa2d616d356fc51bca1e7 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:33:48 +0530 Subject: [PATCH 082/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 3ace55f..b3b144a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -16,6 +16,6 @@ sonar.projectVersion=1.0 #sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java sonar.sources=src -sonar.tests=test +#sonar.tests=test sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes From a6570f6f9c09ec78a0277c69e3bcac17d66673a2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:36:33 +0530 Subject: [PATCH 083/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index b3b144a..c413e17 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -15,7 +15,7 @@ sonar.projectVersion=1.0 #sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java -sonar.sources=src -#sonar.tests=test +sonar.sources=src/main +sonar.tests=src/test sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes From 0cbcdf111a0551ea2c98eb9285fc490ad8c02eab Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:39:02 +0530 Subject: [PATCH 084/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index c413e17..4bb92b9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -15,7 +15,7 @@ sonar.projectVersion=1.0 #sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java -sonar.sources=src/main -sonar.tests=src/test +#sonar.sources=src/main +#sonar.tests=src/test sonar.java.binaries=target/classes sonar.java.test.binaries=target/test-classes From e0a42f217ba32217fedb7405687b8ca04d6b84f6 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:40:30 +0530 Subject: [PATCH 085/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 4bb92b9..ec4ee9a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,5 +17,5 @@ sonar.projectVersion=1.0 #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test -sonar.java.binaries=target/classes -sonar.java.test.binaries=target/test-classes +#sonar.java.binaries=target/classes +#sonar.java.test.binaries=target/test-classes From 98b599c4d535abcf12ef22dfb9393498d040fca6 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:41:14 +0530 Subject: [PATCH 086/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index ec4ee9a..778a860 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,5 +17,5 @@ sonar.projectVersion=1.0 #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test -#sonar.java.binaries=target/classes +sonar.java.binaries=target/classes #sonar.java.test.binaries=target/test-classes From 3b9241cd2e6dcaf59d7c128f32c7ada6f2f85148 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:46:14 +0530 Subject: [PATCH 087/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 778a860..5a703b0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,5 +17,5 @@ sonar.projectVersion=1.0 #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test -sonar.java.binaries=target/classes +sonar.java.binaries=./target/classes #sonar.java.test.binaries=target/test-classes From 25854d7f47d7a0025b18149894b16e8a16373412 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:47:23 +0530 Subject: [PATCH 088/121] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2294b9a..4439376 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,8 +26,9 @@ pipeline { steps { script { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + def mvn = tool 'mvn'; withSonarQubeEnv('bhushan') { - bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" + bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=java2- -Dsonar.projectName='java2-'" } } From d7aa5ce8bcbb32cde339f6564e8e2978416a060a Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:58:16 +0530 Subject: [PATCH 089/121] Update sonar-project.properties --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/sonar-project.properties b/sonar-project.properties index 5a703b0..240e638 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,5 +17,6 @@ sonar.projectVersion=1.0 #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test +sonar.sources=src/main/java sonar.java.binaries=./target/classes #sonar.java.test.binaries=target/test-classes From 8cee285c38988447f40389b39694be91cb100083 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:09:33 +0530 Subject: [PATCH 090/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 240e638..68a1031 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,8 +7,8 @@ sonar.sourceEncoding=UTF-8 sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c # Project identification -sonar.projectKey=java2 -sonar.projectName=java2 +sonar.projectKey=java2- +sonar.projectName=java2- sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list From 1ceaa5ba21bedb2422889c26b9ee5e21248bff7e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:13:52 +0530 Subject: [PATCH 091/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 68a1031..240e638 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,8 +7,8 @@ sonar.sourceEncoding=UTF-8 sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c # Project identification -sonar.projectKey=java2- -sonar.projectName=java2- +sonar.projectKey=java2 +sonar.projectName=java2 sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list From 1519935d04127a3ee2063228cb0a946b171a7494 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:15:18 +0530 Subject: [PATCH 092/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4439376..e693b81 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ pipeline { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' def mvn = tool 'mvn'; withSonarQubeEnv('bhushan') { - bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=java2- -Dsonar.projectName='java2-'" + bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=java2 -Dsonar.projectName='java2'" } } From 9fd110db94b910a8c1857c3c40f48c7e64781e30 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:38:06 +0530 Subject: [PATCH 093/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 240e638..6fa5ac7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,7 +13,7 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -#sonar.java.binaries=**/*.class +sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test From 47f9298aa4393a0843592dd5dddd35be2ce256df Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:42:04 +0530 Subject: [PATCH 094/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 6fa5ac7..2749d5b 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,5 +18,5 @@ sonar.java.binaries=**/*.class #sonar.sources=src/main #sonar.tests=src/test sonar.sources=src/main/java -sonar.java.binaries=./target/classes +#sonar.java.binaries=./target/classes #sonar.java.test.binaries=target/test-classes From 1e8fe23b83ef39b707221173cbc0f367596bb97b Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:47:29 +0530 Subject: [PATCH 095/121] Delete pom.xml --- pom.xml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 pom.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 5ea01ca..0000000 --- a/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - com.example - my-project - 1.0.0 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - - - - - -Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software -A sample Maven project -https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software - - From e7638caf5b9b0651162abd478d68960a97e1fa6e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:53:28 +0530 Subject: [PATCH 096/121] Create pom.xml --- pom.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5ea01ca --- /dev/null +++ b/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + com.example + my-project + 1.0.0 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + + +Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software +A sample Maven project +https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software + + From 2bf064da513d66224e87f891b276c566e5cd43e3 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:54:13 +0530 Subject: [PATCH 097/121] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e693b81..39a8d19 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ pipeline { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' def mvn = tool 'mvn'; withSonarQubeEnv('bhushan') { - bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=java2 -Dsonar.projectName='java2'" + bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=bhushanJAVA -Dsonar.projectName='bhushanJAVA'" } } From 213e70e9fe5b718ee13cb9991d543e9068b71cb2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:55:15 +0530 Subject: [PATCH 098/121] Update sonar-project.properties --- sonar-project.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 2749d5b..7cdbf72 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,8 +7,8 @@ sonar.sourceEncoding=UTF-8 sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c # Project identification -sonar.projectKey=java2 -sonar.projectName=java2 +sonar.projectKey=bhushanJAVA +sonar.projectName=bhushanJAVA sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list @@ -17,6 +17,6 @@ sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test -sonar.sources=src/main/java +#sonar.sources=src/main/java #sonar.java.binaries=./target/classes #sonar.java.test.binaries=target/test-classes From 1807be8dbecdf0fd6d4f95dc486009a817d5b11e Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:55:28 +0530 Subject: [PATCH 099/121] Delete build.gradle --- build.gradle | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 build.gradle diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7cad14e..0000000 --- a/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -plugins { - id "org.sonarqube" version "4.2.1.3168" -} - -sonar { - properties { - property "sonar.projectKey", "java2" - property "sonar.projectName", "java2" - } -} From c7f63ac4ce013dd732ec019edadabc6b6832cc00 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:23:04 +0530 Subject: [PATCH 100/121] Create pom.xml --- .../pom.xml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Book Selling System Java-Using Swing-Mysql/pom.xml diff --git a/Book Selling System Java-Using Swing-Mysql/pom.xml b/Book Selling System Java-Using Swing-Mysql/pom.xml new file mode 100644 index 0000000..5ea01ca --- /dev/null +++ b/Book Selling System Java-Using Swing-Mysql/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + com.example + my-project + 1.0.0 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + + +Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software +A sample Maven project +https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software + + From 5e8ceda87393e70435ca1057b5e7f3c5af8bb976 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:24:04 +0530 Subject: [PATCH 101/121] Create Jenkinsfile --- .../Jenkinsfile | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Book Selling System Java-Using Swing-Mysql/Jenkinsfile diff --git a/Book Selling System Java-Using Swing-Mysql/Jenkinsfile b/Book Selling System Java-Using Swing-Mysql/Jenkinsfile new file mode 100644 index 0000000..39a8d19 --- /dev/null +++ b/Book Selling System Java-Using Swing-Mysql/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + checkout scm + } + } + stage('SCM') { + steps { + // Checkout the code from Git + checkout([$class: 'GitSCM', + branches: [[name: '*/main']], + doGenerateSubmoduleConfigurations: false, + extensions: [], + submoduleCfg: [], + userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software.git']]]) + } + } + + stage('SonarQube Analysis') { + environment { + scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + } + steps { + script { + def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + def mvn = tool 'mvn'; + withSonarQubeEnv('bhushan') { + bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=bhushanJAVA -Dsonar.projectName='bhushanJAVA'" + + } + } + } + } + } +} From 11411d45682cc1fb095ac0c877cbe16fc28357e2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:24:56 +0530 Subject: [PATCH 102/121] Create sonar-project.properties --- .../sonar-project.properties | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Book Selling System Java-Using Swing-Mysql/sonar-project.properties diff --git a/Book Selling System Java-Using Swing-Mysql/sonar-project.properties b/Book Selling System Java-Using Swing-Mysql/sonar-project.properties new file mode 100644 index 0000000..7cdbf72 --- /dev/null +++ b/Book Selling System Java-Using Swing-Mysql/sonar-project.properties @@ -0,0 +1,22 @@ +#----- Default SonarQube server +sonar.host.url=http://localhost:9000/ + +#----- Default source code encoding +sonar.sourceEncoding=UTF-8 + +sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c + +# Project identification +sonar.projectKey=bhushanJAVA +sonar.projectName=bhushanJAVA +sonar.projectVersion=1.0 + +# Define multiple binary directories using a comma-separated list + +sonar.java.binaries=**/*.class +#sonar.exclusions=**/*.java +#sonar.sources=src/main +#sonar.tests=src/test +#sonar.sources=src/main/java +#sonar.java.binaries=./target/classes +#sonar.java.test.binaries=target/test-classes From a06d0ffc945ac00f22ca363a539876e616beb666 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:59:39 +0530 Subject: [PATCH 103/121] Create Add_new_books.java --- Add_new_books.java | 226 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 Add_new_books.java diff --git a/Add_new_books.java b/Add_new_books.java new file mode 100644 index 0000000..bccc6bd --- /dev/null +++ b/Add_new_books.java @@ -0,0 +1,226 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; +import javax.swing.JRadioButton; +import javax.swing.JComboBox; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class Add_new_books extends JFrame { + + private JPanel contentPane; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Add_new_books frame = new Add_new_books(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Add_new_books() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 319, 1014, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewLabel = new JLabel("Book's name :- "); + lblNewLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + lblNewLabel.setBounds(59, 25, 145, 32); + contentPane.add(lblNewLabel); + + JLabel label = new JLabel("Writer's name :- "); + label.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label.setBounds(59, 101, 145, 32); + contentPane.add(label); + + JLabel label_1 = new JLabel("Condition :- "); + label_1.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_1.setBounds(59, 184, 145, 32); + contentPane.add(label_1); + + JTextArea bkname = new JTextArea(); + bkname.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + bkname.setBounds(235, 26, 166, 37); + contentPane.add(bkname); + + JTextArea wrtrname = new JTextArea(); + wrtrname.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + wrtrname.setBounds(235, 102, 166, 37); + contentPane.add(wrtrname); + + JRadioButton rdbtnNewRadioButton = new JRadioButton(" Old"); + rdbtnNewRadioButton.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + rdbtnNewRadioButton.setSelected(false); + rdbtnNewRadioButton.setEnabled(false); + rdbtnNewRadioButton.setBounds(235, 172, 75, 32); + contentPane.add(rdbtnNewRadioButton); + + JRadioButton rdbtnNewRadioButton_1 = new JRadioButton(" New"); + rdbtnNewRadioButton_1.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + rdbtnNewRadioButton_1.setSelected(true); + rdbtnNewRadioButton_1.setEnabled(false); + rdbtnNewRadioButton_1.setBounds(235, 213, 81, 26); + contentPane.add(rdbtnNewRadioButton_1); + + JLabel label_2 = new JLabel(" Published Date :- "); + label_2.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_2.setBounds(481, 25, 158, 32); + contentPane.add(label_2); + + JComboBox date = new JComboBox(); + for(int i=1;i<=31;i++) + { + String str=String.valueOf(i); + date.addItem(str); + } + date.setBounds(662, 32, 48, 27); + contentPane.add(date); + + JComboBox month = new JComboBox(); + month.setBounds(739, 32, 75, 27); + month.addItem("Jan"); + month.addItem("Feb"); + month.addItem("Mar"); + month.addItem("Apr"); + month.addItem("May"); + month.addItem("Jun"); + month.addItem("Jul"); + month.addItem("Aug"); + month.addItem("Sep"); + month.addItem("Oct"); + month.addItem("Nov"); + month.addItem("Dec"); + contentPane.add(month); + + JComboBox year = new JComboBox(); + for(int i=1901;i<=2018;i++) + { + String str=String.valueOf(i); + year.addItem(str); + } + year.setBounds(841, 32, 109, 27); + contentPane.add(year); + + JLabel label_3 = new JLabel(" Subject's name :- "); + label_3.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_3.setBounds(481, 184, 158, 32); + contentPane.add(label_3); + + JComboBox sub = new JComboBox(); + sub.setBounds(662, 188, 166, 32); + sub.addItem("English"); + sub.addItem("Hindi"); + sub.addItem("Bengali"); + sub.addItem("Maths"); + sub.addItem("Physics"); + sub.addItem("Chemistry"); + sub.addItem("Biology"); + sub.addItem("Computer"); + sub.addItem("History"); + sub.addItem("Geography"); + sub.addItem("Others"); + contentPane.add(sub); + + JLabel label_4 = new JLabel(" Price (INR) :- "); + label_4.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_4.setBounds(481, 261, 145, 32); + contentPane.add(label_4); + + JTextArea publs = new JTextArea(); + publs.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + publs.setBounds(662, 102, 166, 37); + contentPane.add(publs); + + JLabel label_5 = new JLabel(" Publisher name :- "); + label_5.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_5.setBounds(481, 101, 169, 32); + contentPane.add(label_5); + + JTextArea price = new JTextArea(); + price.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + price.setBounds(662, 262, 166, 37); + contentPane.add(price); + + JLabel label_6 = new JLabel("Source :- "); + label_6.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_6.setBounds(59, 261, 145, 32); + contentPane.add(label_6); + + JTextArea src = new JTextArea(); + src.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + src.setBounds(235, 262, 166, 37); + contentPane.add(src); + + JButton btnNewButton = new JButton("Add"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int a=JOptionPane.showConfirmDialog(btnNewButton,"Are you sure?"); + //JOptionPane.setRootFrame(null); + if(a==JOptionPane.YES_OPTION){ + + String name=bkname.getText(); + String writer= wrtrname.getText(); + String condition="New"; + String source=src.getText(); + String publisher=publs.getText(); + String subject= (String) sub.getSelectedItem(); + String prc=price.getText(); + String dt=(String) date.getSelectedItem(); + String mnth=(String) month.getSelectedItem(); + String yr=(String) year.getSelectedItem(); + + if(name != "" && writer != "" && source != null && prc != null && publisher != null) + { + String n="\n"; + + + JOptionPane.showMessageDialog(btnNewButton,"Congratulations,"+n+"Book is added sucessfully"+n+"Thankyou."); + } + else + { + + JOptionPane.showMessageDialog(btnNewButton,"Please,enter the informations"); + } + } + + } + }); + btnNewButton.setFont(new Font("Segoe UI", Font.PLAIN, 30)); + btnNewButton.setBounds(376, 318, 197, 80); + contentPane.add(btnNewButton); + } +} From 813b39b28ac62d6adb7fb2661b622bcc5d7144d3 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:01:32 +0530 Subject: [PATCH 104/121] Create Add_old_books.java --- Add_old_books.java | 226 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 Add_old_books.java diff --git a/Add_old_books.java b/Add_old_books.java new file mode 100644 index 0000000..9f88137 --- /dev/null +++ b/Add_old_books.java @@ -0,0 +1,226 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JTextField; +import javax.swing.JRadioButton; +import javax.swing.JComboBox; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class Add_old_books extends JFrame { + + private JPanel contentPane; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Add_old_books frame = new Add_old_books(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Add_old_books() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 319, 1014, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewLabel = new JLabel("Book's name :- "); + lblNewLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + lblNewLabel.setBounds(59, 25, 145, 32); + contentPane.add(lblNewLabel); + + JLabel label = new JLabel("Writer's name :- "); + label.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label.setBounds(59, 101, 145, 32); + contentPane.add(label); + + JLabel label_1 = new JLabel("Condition :- "); + label_1.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_1.setBounds(59, 184, 145, 32); + contentPane.add(label_1); + + JTextArea bkname = new JTextArea(); + bkname.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + bkname.setBounds(235, 26, 166, 37); + contentPane.add(bkname); + + JTextArea wrtrname = new JTextArea(); + wrtrname.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + wrtrname.setBounds(235, 102, 166, 37); + contentPane.add(wrtrname); + + JRadioButton rdbtnNewRadioButton = new JRadioButton(" Old"); + rdbtnNewRadioButton.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + rdbtnNewRadioButton.setSelected(true); + rdbtnNewRadioButton.setEnabled(false); + rdbtnNewRadioButton.setBounds(235, 172, 75, 32); + contentPane.add(rdbtnNewRadioButton); + + JRadioButton rdbtnNewRadioButton_1 = new JRadioButton(" New"); + rdbtnNewRadioButton_1.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + rdbtnNewRadioButton_1.setSelected(false); + rdbtnNewRadioButton_1.setEnabled(false); + rdbtnNewRadioButton_1.setBounds(235, 213, 81, 26); + contentPane.add(rdbtnNewRadioButton_1); + + JLabel label_2 = new JLabel(" Published Date :- "); + label_2.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_2.setBounds(481, 25, 158, 32); + contentPane.add(label_2); + + JComboBox date = new JComboBox(); + for(int i=1;i<=31;i++) + { + String str=String.valueOf(i); + date.addItem(str); + } + date.setBounds(662, 32, 48, 27); + contentPane.add(date); + + JComboBox month = new JComboBox(); + month.setBounds(739, 32, 75, 27); + month.addItem("Jan"); + month.addItem("Feb"); + month.addItem("Mar"); + month.addItem("Apr"); + month.addItem("May"); + month.addItem("Jun"); + month.addItem("Jul"); + month.addItem("Aug"); + month.addItem("Sep"); + month.addItem("Oct"); + month.addItem("Nov"); + month.addItem("Dec"); + contentPane.add(month); + + JComboBox year = new JComboBox(); + for(int i=1901;i<=2018;i++) + { + String str=String.valueOf(i); + year.addItem(str); + } + year.setBounds(841, 32, 109, 27); + contentPane.add(year); + + JLabel label_3 = new JLabel(" Subject's name :- "); + label_3.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_3.setBounds(481, 184, 158, 32); + contentPane.add(label_3); + + JComboBox sub = new JComboBox(); + sub.setBounds(662, 188, 166, 32); + sub.addItem("English"); + sub.addItem("Hindi"); + sub.addItem("Bengali"); + sub.addItem("Maths"); + sub.addItem("Physics"); + sub.addItem("Chemistry"); + sub.addItem("Biology"); + sub.addItem("Computer"); + sub.addItem("History"); + sub.addItem("Geography"); + sub.addItem("Others"); + contentPane.add(sub); + + JLabel label_4 = new JLabel(" Price (INR) :- "); + label_4.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_4.setBounds(481, 261, 145, 32); + contentPane.add(label_4); + + JTextArea publs = new JTextArea(); + publs.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + publs.setBounds(662, 102, 166, 37); + contentPane.add(publs); + + JLabel label_5 = new JLabel(" Publisher name :- "); + label_5.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_5.setBounds(481, 101, 169, 32); + contentPane.add(label_5); + + JTextArea price = new JTextArea(); + price.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + price.setBounds(662, 262, 166, 37); + contentPane.add(price); + + JLabel label_6 = new JLabel("Source :- "); + label_6.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_6.setBounds(59, 261, 145, 32); + contentPane.add(label_6); + + JTextArea src = new JTextArea(); + src.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + src.setBounds(235, 262, 166, 37); + contentPane.add(src); + + JButton btnNewButton = new JButton("Add"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int a=JOptionPane.showConfirmDialog(btnNewButton,"Are you sure?"); + //JOptionPane.setRootFrame(null); + if(a==JOptionPane.YES_OPTION){ + + String name=bkname.getText(); + String writer= wrtrname.getText(); + String condition="Old"; + String source=src.getText(); + String publisher=publs.getText(); + String subject= (String) sub.getSelectedItem(); + String prc=price.getText(); + String dt=(String) date.getSelectedItem(); + String mnth=(String) month.getSelectedItem(); + String yr=(String) year.getSelectedItem(); + + if(name != "" && writer != "" && source != null && prc != null && publisher != null) + { + String n="\n"; + + + JOptionPane.showMessageDialog(btnNewButton,"Congratulations,"+n+"Book is added sucessfully"+n+"Thankyou."); + } + else + { + + JOptionPane.showMessageDialog(btnNewButton,"Please,enter the informations"); + } + } + + } + }); + btnNewButton.setFont(new Font("Segoe UI", Font.PLAIN, 30)); + btnNewButton.setBounds(376, 318, 197, 80); + contentPane.add(btnNewButton); + } +} From 0ca10deae94d2ff9ed130633fe13f2709bbbfb39 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:02:10 +0530 Subject: [PATCH 105/121] Create Address.java --- Address.java | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Address.java diff --git a/Address.java b/Address.java new file mode 100644 index 0000000..93c71f6 --- /dev/null +++ b/Address.java @@ -0,0 +1,135 @@ +package Textbook_selling_system; + +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; + +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.border.EmptyBorder; +import javax.swing.JEditorPane; +import javax.swing.JButton; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import java.awt.ScrollPane; +import java.awt.Toolkit; +import java.awt.event.ActionListener; +import java.util.Random; +import java.awt.event.ActionEvent; + +public class Address extends JFrame { + + private JPanel contentPane; + public String name; + public String pin; + public String addl; + public String landmark; + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Address frame = new Address(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Address() { + // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(650, 319, 514, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + + JLabel name = new JLabel("Full Name :- "); + name.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + name.setBounds(26, 13, 117, 41); + contentPane.add(name); + + JTextArea namet = new JTextArea(); + namet.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + namet.setBounds(155, 15, 325, 39); + contentPane.add(namet); + + JLabel label = new JLabel("Pincode :- "); + label.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label.setBounds(26, 74, 117, 41); + contentPane.add(label); + + JTextArea pint = new JTextArea(); + pint.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + pint.setBounds(155, 79, 165, 41); + contentPane.add(pint); + + JLabel label_1 = new JLabel("Address :- "); + label_1.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_1.setBounds(26, 150, 117, 41); + contentPane.add(label_1); + + JEditorPane editorPane = new JEditorPane(); + editorPane.setBounds(155, 133, 325, 124); + contentPane.add(editorPane); + + JLabel label_2 = new JLabel("Landmark :- "); + label_2.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + label_2.setBounds(26, 282, 117, 41); + contentPane.add(label_2); + + JTextArea landmarkt = new JTextArea(); + landmarkt.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + landmarkt.setBounds(155, 287, 165, 41); + contentPane.add(landmarkt); + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + + JButton btnAdd = new JButton("Add"); + btnAdd.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + dispose(); + int a=JOptionPane.showConfirmDialog(btnAdd, "Are you ready to process your order?"); + if(a==JOptionPane.YES_OPTION) + { + String name=namet.getText(); + String pin=pint.getText(); + String add=editorPane.getText(); + String landmark=landmarkt.getText(); + + + Random rand=new Random(); + int i=rand.nextInt(9999999); + String tktno=String.valueOf(i); + tktno+="\n"; + String n="\n"; + //seatb+=")\n"; + + String id=String.valueOf(i); + + + JOptionPane.showMessageDialog(btnAdd,"Congratulations,"+n+"Your order is successfully placed"+n+"Your Order Id is "+i+n+"Thankyou."); + + + //JOptionPane.showMessageDialog(btnAdd, "Cogratulations,Your order is successfully placed"); + } + } + }); + btnAdd.setBounds(148, 338, 172, 74); + contentPane.add(btnAdd); + } +} From 5c78090a1c1c3061ce1aa6c83d1bb8721ea20350 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:05:41 +0530 Subject: [PATCH 106/121] Create AdminHost.java --- AdminHost.java | 208 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 AdminHost.java diff --git a/AdminHost.java b/AdminHost.java new file mode 100644 index 0000000..ae23c73 --- /dev/null +++ b/AdminHost.java @@ -0,0 +1,208 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Toolkit; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.JTree; +import javax.swing.event.AncestorListener; +import javax.swing.event.AncestorEvent; +import javax.swing.JTable; +import javax.swing.JScrollBar; +import javax.swing.JEditorPane; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.ImageIcon; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JLabel; +import java.awt.Font; + +public class AdminHost extends JFrame { + + private JPanel contentPane; + private JTable table; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + AdminHost frame = new AdminHost(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public AdminHost() { + + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JMenuBar menuBar = new JMenuBar(); + menuBar.setBounds(0, 0, 1008, 26); + contentPane.add(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Main Menu"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmAddOldBooks = new JMenuItem("Add Old Books"); + mntmAddOldBooks.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_old_books obj=new Add_old_books(); + obj.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAddOldBooks); + + JMenuItem mntmAddNewBooks = new JMenuItem("Add New Books"); + mntmAddNewBooks.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_new_books obj=new Add_new_books(); + obj.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAddNewBooks); + + JMenu menu = new JMenu("Manage"); + menuBar.add(menu); + + + + JMenu mnNewMenu_2 = new JMenu("Orders"); + menu.add(mnNewMenu_2); + + JMenuItem menuItem1 = new JMenuItem("Show Orders"); + mnNewMenu_2.add(menuItem1); + + JMenuItem menuItem2 = new JMenuItem("Manage Orders"); + mnNewMenu_2.add(menuItem2); + + JMenu mnNewMenu_3 = new JMenu("User/Admin"); + menu.add(mnNewMenu_3); + + + JMenuItem menuItem_1 = new JMenuItem("Manage Users"); + mnNewMenu_3.add(menuItem_1); + + JMenuItem menuItem_2 = new JMenuItem("Manage Admins"); + mnNewMenu_3.add(menuItem_2); + + JButton btnNewButton = new JButton("Log Out"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int a=JOptionPane.showConfirmDialog(btnNewButton,"Are you sure?"); + //JOptionPane.setRootFrame(null); + if(a==JOptionPane.YES_OPTION){ + + dispose(); + Main_screen ms=new Main_screen(); + ms.setTitle("Book Hub"); + ms.setVisible(true); + } + } + }); + btnNewButton.setBounds(899, 39, 97, 25); + contentPane.add(btnNewButton); + + JButton add = new JButton("Add old books"); + add.setFont(new Font("Tahoma", Font.PLAIN, 29)); + add.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_old_books obj=new Add_old_books(); + obj.setVisible(true); + } + }); + add.setBounds(46, 197, 264, 118); + contentPane.add(add); + + JButton btnNewButton_1 = new JButton("Add new Books"); + btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 29)); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_new_books obj=new Add_new_books(); + obj.setVisible(true); + } + }); + btnNewButton_1.setBounds(374, 197,264, 118); + contentPane.add(btnNewButton_1); + + JButton button = new JButton("Show orders"); + button.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Show_bookings obj=new Show_bookings(); + obj.setVisible(true); + } + }); + button.setBounds(699, 197, 264, 118); + contentPane.add(button); + + JButton button_1 = new JButton("Manage users"); + button_1.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button_1.setBounds(374, 366, 264, 118); + contentPane.add(button_1); + + JButton button_2 = new JButton("Manage Orders"); + button_2.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button_2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + } + }); + button_2.setBounds(46, 366, 264, 118); + contentPane.add(button_2); + + JButton button_3 = new JButton("Manage Admin"); + button_3.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button_3.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + } + }); + button_3.setBounds(699, 366, 264, 118); + contentPane.add(button_3); + + JMenu mnNewMenu = new JMenu("New menu"); + mnNewMenu.setBounds(0, 39, 58, -32); + contentPane.add(mnNewMenu); + + JLabel label = new JLabel(""); + label.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\37467261-books-wallpaper (Custom).jpg")); + label.setBounds(0, 26, 1008, 536); + contentPane.add(label); + + + + + + + + + + } +} From 087ca65fca7f8bfcb069fd065bd6d412c927bdbe Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:06:24 +0530 Subject: [PATCH 107/121] Create AdminLogin.java --- AdminLogin.java | 147 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 AdminLogin.java diff --git a/AdminLogin.java b/AdminLogin.java new file mode 100644 index 0000000..07aa629 --- /dev/null +++ b/AdminLogin.java @@ -0,0 +1,147 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.Color; + +import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; + +import javax.swing.border.EmptyBorder; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.Color; + +public class AdminLogin extends JFrame { + + private JPanel contentPane; + private JTextField textField; + private JPasswordField passwordField; + private JButton btnNewButton; + private JButton btnNewButton_1; + private String user[]={"Soumyadip","Soumya"}; + private String pass[]={"abcd","abcde"}; + private JLabel lblNewLabel_1; + private JLabel label; + private JLabel label_1; + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + AdminLogin frame = new AdminLogin(); + frame.setTitle("Book Hub"); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public AdminLogin() { + setResizable(false); + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + // .getContentPane().//(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\STDM.jpg")); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewLabel = new JLabel("Admin Login"); + lblNewLabel.setForeground(new Color(255, 255, 102)); + lblNewLabel.setFont(new Font("Times New Roman", Font.PLAIN, 46)); + lblNewLabel.setBounds(364, 60, 273, 93); + contentPane.add(lblNewLabel); + + textField = new JTextField(); + textField.setFont(new Font("Tahoma", Font.PLAIN, 32)); + textField.setBounds(481, 170, 281, 68); + contentPane.add(textField); + textField.setColumns(10); + + passwordField = new JPasswordField(); + passwordField.setFont(new Font("Tahoma", Font.PLAIN, 32)); + passwordField.setBounds(481, 286, 281, 68); + contentPane.add(passwordField); + + JLabel lblUsername = new JLabel("Username"); + lblUsername.setForeground(new Color(255, 255, 255)); + lblUsername.setFont(new Font("Tahoma", Font.PLAIN, 31)); + lblUsername.setBounds(250, 166, 193, 52); + contentPane.add(lblUsername); + + JLabel lblPassword = new JLabel("Password"); + lblPassword.setForeground(new Color(255, 255, 255)); + lblPassword.setBackground(Color.CYAN); + lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 31)); + lblPassword.setBounds(250, 286, 193, 52); + contentPane.add(lblPassword); + + btnNewButton = new JButton("Login"); + btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 26)); + btnNewButton.setBounds(545, 392, 162, 73); + btnNewButton.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + // TODO Auto-generated method stub + int i=0,j=0; + String ustr=textField.getText(); + String pstr=passwordField.getText(); + + + if( ustr.equals("Soumya") && pstr.equals("1234")) + { + dispose(); + AdminHost ah=new AdminHost(); + ah.setTitle("Book Hub"); + ah.setVisible(true); + JOptionPane.showMessageDialog(btnNewButton, "You have successfully logged in"); + } + else + { + JOptionPane.showMessageDialog(btnNewButton, "Wrong Username & Password"); + } + } + }); + + contentPane.add(btnNewButton); + + btnNewButton_1 = new JButton("User Login"); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + Userlogin us=new Userlogin(); + us.setTitle("Book Hub"); + us.setVisible(true); + } + }); + btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 26)); + btnNewButton_1.setBounds(250, 387, 193, 83); + contentPane.add(btnNewButton_1); + + label_1 = new JLabel(""); + label_1.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\books-wallpaper-49796-51475-hd-wallpapers (Custom).jpg")); + label_1.setBounds(0, 0, 1008, 562); + contentPane.add(label_1); + + + + } + +} From 968adfdbbd7287644fbfe762c4f9b69b8eba279b Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:07:05 +0530 Subject: [PATCH 108/121] Create Book_selling_system.java --- Book_selling_system.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Book_selling_system.java diff --git a/Book_selling_system.java b/Book_selling_system.java new file mode 100644 index 0000000..3e350c0 --- /dev/null +++ b/Book_selling_system.java @@ -0,0 +1,19 @@ +package Textbook_selling_system; + +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ + +public class Book_selling_system { + + + public static void main(String args[]) + { + Main_screen ms=new Main_screen(); + ms.setTitle("Book Hub"); + ms.setVisible(true); + } +} From 95723192096dde01d7f08256229a4ccdbd097076 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:08:11 +0530 Subject: [PATCH 109/121] Create BuyBooks.java --- BuyBooks.java | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 BuyBooks.java diff --git a/BuyBooks.java b/BuyBooks.java new file mode 100644 index 0000000..5a03032 --- /dev/null +++ b/BuyBooks.java @@ -0,0 +1,87 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Toolkit; + +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.table.DefaultTableModel; +import javax.swing.JTable; +import javax.swing.JProgressBar; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class BuyBooks extends JFrame { + + private JPanel contentPane; + + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + BuyBooks frame = new BuyBooks(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public BuyBooks() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setBounds(450, 319, 1014, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + String col[]={"Book name","Price","Writter"}; + String data[][]={{"Eng","AAA","S.C"}}; + + JTable table = new JTable(data,col); + DefaultTableModel md=new DefaultTableModel(); + md.setColumnIdentifiers(col); + + table.setModel(md); + + table.setBounds(0, 0, 1008, 303); + table.setFillsViewportHeight(true); + contentPane.add(table); + + JProgressBar progressBar = new JProgressBar(); + progressBar.setBounds(157, 193, 146, 14); + contentPane.add(progressBar); + + JButton btnNewButton = new JButton("Buy"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Address obj=new Address(); + obj.setVisible(true); + + //contentPane.add(obj); + // JOptionPane.showMessageDialog(btnNewButton, "Co; + } + }); + btnNewButton.setBounds(430, 316, 168, 96); + contentPane.add(btnNewButton); + } +} From 49f0a55314f107eca064cb6b3f43e49053cda7ea Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:08:39 +0530 Subject: [PATCH 110/121] Create Create_ac.java --- Create_ac.java | 248 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 Create_ac.java diff --git a/Create_ac.java b/Create_ac.java new file mode 100644 index 0000000..1097a23 --- /dev/null +++ b/Create_ac.java @@ -0,0 +1,248 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.border.EmptyBorder; +import javax.swing.ImageIcon; +import java.awt.Color; + +public class Create_ac extends JFrame { + + private JPanel contentPane; + private JTextField firstname; + private JTextField lastname; + private JTextField email; + private JTextField username; + private JTextField mob; + private JPasswordField passwordField; + private JButton btnNewButton; + private JButton btnNewButton_1; + private JButton btnNewButton_2; + private JLabel label; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Create_ac frame = new Create_ac(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + + public Create_ac() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewUserRegister = new JLabel("New User Register"); + lblNewUserRegister.setForeground(new Color(102, 255, 0)); + lblNewUserRegister.setFont(new Font("Times New Roman", Font.PLAIN, 42)); + lblNewUserRegister.setBounds(362, 52, 325, 50); + contentPane.add(lblNewUserRegister); + + JLabel lblName = new JLabel("First name"); + lblName.setForeground(new Color(255, 204, 51)); + lblName.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblName.setBounds(58, 151, 99, 43); + contentPane.add(lblName); + + JLabel lblNewLabel = new JLabel("Last name"); + lblNewLabel.setForeground(new Color(255, 204, 0)); + lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblNewLabel.setBounds(58, 243, 110, 29); + contentPane.add(lblNewLabel); + + JLabel lblEmailAddress = new JLabel("Email\r\n address"); + lblEmailAddress.setForeground(new Color(255, 204, 0)); + lblEmailAddress.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblEmailAddress.setBounds(58, 324, 124, 36); + contentPane.add(lblEmailAddress); + + firstname = new JTextField(); + firstname.setFont(new Font("Tahoma", Font.PLAIN, 32)); + firstname.setBounds(214, 151, 228, 50); + contentPane.add(firstname); + firstname.setColumns(10); + + lastname = new JTextField(); + lastname.setFont(new Font("Tahoma", Font.PLAIN, 32)); + lastname.setBounds(214, 235, 228, 50); + contentPane.add(lastname); + lastname.setColumns(10); + + email = new JTextField(); + + email.setFont(new Font("Tahoma", Font.PLAIN, 32)); + email.setBounds(214, 320, 228, 50); + contentPane.add(email); + email.setColumns(10); + + username = new JTextField(); + username.setFont(new Font("Tahoma", Font.PLAIN, 32)); + username.setBounds(707, 151, 228, 50); + contentPane.add(username); + username.setColumns(10); + + JLabel lblUsername = new JLabel("Username"); + lblUsername.setForeground(new Color(255, 204, 0)); + lblUsername.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblUsername.setBounds(542, 159, 99, 29); + contentPane.add(lblUsername); + + JLabel lblPassword = new JLabel("Password"); + lblPassword.setForeground(new Color(255, 204, 0)); + lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblPassword.setBounds(542, 245, 99, 24); + contentPane.add(lblPassword); + + JLabel lblMobileNumber = new JLabel("Mobile number"); + lblMobileNumber.setForeground(new Color(255, 204, 0)); + lblMobileNumber.setFont(new Font("Tahoma", Font.PLAIN, 20)); + lblMobileNumber.setBounds(542, 329, 139, 26); + contentPane.add(lblMobileNumber); + + mob = new JTextField(); + mob.setFont(new Font("Tahoma", Font.PLAIN, 32)); + mob.setBounds(707, 320, 228, 50); + contentPane.add(mob); + mob.setColumns(10); + + passwordField = new JPasswordField(); + passwordField.setFont(new Font("Tahoma", Font.PLAIN, 32)); + passwordField.setBounds(707, 235, 228, 50); + contentPane.add(passwordField); + + btnNewButton = new JButton("Register"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String first=firstname.getText(); + String last=lastname.getText(); + String emailadd=email.getText(); + String user1=username.getText(); + String mb=mob.getText(); + int len=mb.length(); + String pass1=passwordField.getText(); + + String msg=""+first; + msg+=" \n"; + if(len==10) + { + try{ + // String drivername="com.microsoft.sqlserver.jdbc.SQLServerDriver"; + // Class.forName("com.mysql.jdbc.Driver"); + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/book selling system","root",""); + //Statement st=con.createStatement(); + + String query="INSERT INTO account VALUES('"+first+"','"+last+"','"+user1+"','"+pass1+"','"+emailadd+"','"+mb+"')"; + Statement sta=con.createStatement(); + int x=sta.executeUpdate(query); + if(x==0) + { + JOptionPane.showMessageDialog(btnNewButton, "User name is alredy exist"); + } + else + { + JOptionPane.showMessageDialog(btnNewButton,"Welcome, "+msg+"Your account is sucessfully created"); + } + con.close(); + } + catch(Exception f) + { + System.out.println(f.getMessage()); + } + } + else + { + JOptionPane.showMessageDialog(btnNewButton, "Enter a valid mobile number"); + } + + + /* try{ + String drivername="com.microsoft.sqlserver.jdbc.SQLServerDriver";//driver name + Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + String db="jdbc:sqlserver://PERSONAL\\SQLEXPRESS:1433;databaseName=test"; + String user="PERSONAL/Soumyadeep"; + String pass=""; + String query="SELECT * FROM INSERT INTO user_details('','"+first+"','"+last+"','"+user1+"','"+pass1+"','"+emailadd+"','"+mb+"')"; + Connection con=DriverManager.getConnection(db,user,pass); + Statement st=con.createStatement(); + int x=st.executeUpdate(query); + if(x==1) + { + JOptionPane.showMessageDialog(btnNewButton, "This is alredy exist"); + } + con.close(); + } + catch(Exception f) + { + System.out.println(f.getMessage()); + } */ + //JOptionPane.showMessageDialog(btnNewButton,"Welcome, "+msg+"Your account is sucessfully created"); + } + }); + btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton.setBounds(345, 397, 139, 50); + contentPane.add(btnNewButton); + + btnNewButton_1 = new JButton("Already Have Account ? Sign in"); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + Userlogin us=new Userlogin(); + us.setTitle("Book Hub"); + us.setVisible(true); + } + }); + btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton_1.setBounds(297, 474, 435, 50); + contentPane.add(btnNewButton_1); + + btnNewButton_2 = new JButton("Reset\r\n\r\n\r\n"); + btnNewButton_2.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton_2.setBounds(542, 397, 139, 50); + contentPane.add(btnNewButton_2); + + label = new JLabel(""); + label.setForeground(new Color(255, 204, 0)); + label.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\3 (Custom).jpg")); + label.setBounds(0, 0, 1008, 562); + contentPane.add(label); + } +} From 08a6f98e492ea4a8b17570a05c7c6d926d173e78 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:09:18 +0530 Subject: [PATCH 111/121] Create Main_screen.java --- Main_screen.java | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Main_screen.java diff --git a/Main_screen.java b/Main_screen.java new file mode 100644 index 0000000..d4bb2db --- /dev/null +++ b/Main_screen.java @@ -0,0 +1,117 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; + +public class Main_screen extends JFrame { + + /** + * + */ + private static final long serialVersionUID = 1L; + private JPanel contentPane; + +// MainScreen frame; + + + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + + Main_screen frame = new Main_screen(); + frame.setTitle(""); + frame.setVisible(true); + + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + } + + /** + * Create the frame. + */ + public Main_screen() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + setResizable(false); + //contentPane.setTitle(); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewLabel = new JLabel("Book Hub"); + lblNewLabel.setBackground(new Color(255, 200, 0)); + lblNewLabel.setForeground(new Color(204, 255, 0)); + lblNewLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 50)); + lblNewLabel.setBounds(54, 0, 230, 98); + contentPane.add(lblNewLabel); + + JButton AdminBtn = new JButton("Admin Login"); + AdminBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + } + }); + AdminBtn.setFont(new Font("Tahoma", Font.PLAIN, 32)); + AdminBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + AdminLogin ad=new AdminLogin(); + ad.setTitle("Book Hub"); + ad.setVisible(true); + } + }); + AdminBtn.setBounds(128, 245, 243, 93); + contentPane.add(AdminBtn); + + JButton UserBtn = new JButton("User Login"); + + UserBtn.setFont(new Font("Tahoma", Font.PLAIN, 32)); + UserBtn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + Userlogin ad=new Userlogin(); + ad.setTitle("Book Hub"); + ad.setVisible(true); + } + }); + UserBtn.setBounds(647, 245, 243, 93); + contentPane.add(UserBtn); + + + + JLabel lblBuySellRecycle = new JLabel("Buy Sell Recycle"); + lblBuySellRecycle.setForeground(new Color(255, 255, 204)); + lblBuySellRecycle.setFont(new Font("Sylfaen", Font.PLAIN, 28)); + lblBuySellRecycle.setBounds(136, 52, 431, 86); + contentPane.add(lblBuySellRecycle); + + JLabel lblNewLabel_1 = new JLabel(""); + lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + lblNewLabel_1.setBounds(0, 0, 1008, 562); + contentPane.add(lblNewLabel_1); + + } +} From b05b9e3ca9182f55b0f1dfcdfa2b6f83261140a8 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:09:53 +0530 Subject: [PATCH 112/121] Create Request.java --- Request.java | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Request.java diff --git a/Request.java b/Request.java new file mode 100644 index 0000000..d0dd947 --- /dev/null +++ b/Request.java @@ -0,0 +1,98 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.JTextArea; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JButton; +import javax.swing.JTextField; +import java.awt.event.ActionListener; +import java.util.Random; +import java.awt.event.ActionEvent; + +public class Request extends JFrame { + + private JPanel contentPane; + private JTextField textField; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Request frame = new Request(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Request() { + setBounds(450, 319, 1014, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JTextArea textArea = new JTextArea(); + textArea.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + textArea.setBounds(12, 66, 984, 276); + contentPane.add(textArea); + + JLabel lblNewLabel = new JLabel("Enter your Email :-"); + lblNewLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + lblNewLabel.setBounds(12, 13, 168, 39); + contentPane.add(lblNewLabel); + + + + textField = new JTextField(); + textField.setFont(new Font("Segoe UI", Font.PLAIN, 20)); + textField.setBounds(192, 13, 423, 39); + contentPane.add(textField); + textField.setColumns(10); + + JButton btnRequest = new JButton("Request"); + btnRequest.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String email=textField.getText(); + String complain=textArea.getText(); + + + Random rand=new Random(); + int i=rand.nextInt(9999999); + String tktno=String.valueOf(i); + tktno+="\n"; + String n="\n"; + //seatb+=")\n"; + + String id=String.valueOf(i); + + JOptionPane.showMessageDialog(btnRequest,"Congratulations,"+n+"We have recived your request"+n+"We'll contact to you within 24 working hrs"+n+"Your Request id is"+i+n+"Thankyou."); + + } + }); + btnRequest.setFont(new Font("Segoe UI", Font.PLAIN, 30)); + btnRequest.setBounds(405, 355, 259, 57); + contentPane.add(btnRequest); + } +} From 6fd953d1ef5fa8d2fcf602c4a53ed4246c0248dc Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:10:32 +0530 Subject: [PATCH 113/121] Create Show_bookings.java --- Show_bookings.java | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Show_bookings.java diff --git a/Show_bookings.java b/Show_bookings.java new file mode 100644 index 0000000..2c04b41 --- /dev/null +++ b/Show_bookings.java @@ -0,0 +1,69 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Toolkit; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.JToggleButton; +import javax.swing.JTable; + +public class Show_bookings extends JFrame { + + private JPanel contentPane; + private final JTable table = new JTable(); + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Show_bookings frame = new Show_bookings(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Show_bookings() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setBounds(450, 319, 1014, 460); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + + String col[]={"Name","Username","Address","Book name","Price","Conition"}; + String col1[][] = null; + DefaultTableModel md=new DefaultTableModel(); + md.setColumnIdentifiers(col); + + + JTable jt=new JTable(col1,col); + jt.setBounds(1, 1, 1008, 425); + jt.setModel(md); + contentPane.add(jt); + //jt.addColumnSelectionInterval(col); + + + } + } From 1cb2eecbcb7113753b098f18c57894e10e41bba2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:11:12 +0530 Subject: [PATCH 114/121] Create UserHost.java --- UserHost.java | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 UserHost.java diff --git a/UserHost.java b/UserHost.java new file mode 100644 index 0000000..e1bbe98 --- /dev/null +++ b/UserHost.java @@ -0,0 +1,196 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import javax.swing.ImageIcon; + +public class UserHost extends JFrame { + + private JPanel contentPane; + private JTable table; + + +public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + UserHost frame = new UserHost(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); +} + +/** + * Create the frame. + */ + public UserHost() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + + // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JMenuBar menuBar = new JMenuBar(); + menuBar.setBounds(0, 0, 1008, 26); + contentPane.add(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Main Menu"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmAddOldBooks = new JMenuItem("Buy Books"); + mntmAddOldBooks.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BuyBooks obj=new BuyBooks(); + obj.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAddOldBooks); + + JMenuItem mntmAddNewBooks = new JMenuItem("Recycle your books"); + mntmAddNewBooks.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_old_books obj=new Add_old_books(); + obj.setVisible(true); + } + }); + mnNewMenu_1.add(mntmAddNewBooks); + + JMenu menu = new JMenu("Manage"); + menuBar.add(menu); + + + + JMenu mnNewMenu_2 = new JMenu("Orders"); + menu.add(mnNewMenu_2); + + JMenuItem menuItem1 = new JMenuItem("Show Orders"); + mnNewMenu_2.add(menuItem1); + + JMenuItem menuItem2 = new JMenuItem("Manage Orders"); + mnNewMenu_2.add(menuItem2); + + JMenu mnNewMenu_3 = new JMenu("User/Admin"); + menu.add(mnNewMenu_3); + + + JMenuItem menuItem_1 = new JMenuItem("Manage Users"); + mnNewMenu_3.add(menuItem_1); + + JMenuItem menuItem_2 = new JMenuItem("Manage Admins"); + mnNewMenu_3.add(menuItem_2); + + JButton btnNewButton = new JButton("Log Out"); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int a=JOptionPane.showConfirmDialog(btnNewButton,"Are you sure?"); + //JOptionPane.setRootFrame(null); + if(a==JOptionPane.YES_OPTION){ + + dispose(); + Main_screen ms=new Main_screen(); + ms.setTitle("Book Hub"); + ms.setVisible(true); + } + } + }); + btnNewButton.setBounds(899, 39, 97, 25); + contentPane.add(btnNewButton); + + JButton add = new JButton("Buy Books"); + add.setFont(new Font("Tahoma", Font.PLAIN, 29)); + add.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BuyBooks obj=new BuyBooks(); + obj.setVisible(true); + } + }); + add.setBounds(46, 197, 264, 118); + contentPane.add(add); + JButton btnNewButton_1 = new JButton("Recycle Books "); + btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 29)); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Add_old_books obj=new Add_old_books(); + obj.setVisible(true); + } + }); + btnNewButton_1.setBounds(374, 197,264, 118); + contentPane.add(btnNewButton_1); + + JButton button = new JButton("History"); + button.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + BuyBooks obj=new BuyBooks(); + obj.setVisible(true); + } + }); + button.setBounds(699, 197, 264, 118); + contentPane.add(button); + + JButton button_1 = new JButton("Request"); + button_1.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Request obj=new Request(); + obj.setVisible(true); + } + }); + button_1.setBounds(237, 366, 264, 118); + contentPane.add(button_1); + + JButton button_3 = new JButton("Connect us"); + button_3.setFont(new Font("Tahoma", Font.PLAIN, 29)); + button_3.setBounds(550, 366, 264, 118); + contentPane.add(button_3); + + JLabel lblNewLabel = new JLabel("Book Hub"); + lblNewLabel.setBackground(new Color(255, 200, 0)); + lblNewLabel.setForeground(new Color(255, 255, 0)); + lblNewLabel.setFont(new Font("Comic Sans MS", Font.PLAIN, 50)); + lblNewLabel.setBounds(24, 25, 230, 98); + contentPane.add(lblNewLabel); + + + JLabel lblBuySellRecycle = new JLabel("Buy Sell Recycle"); + lblBuySellRecycle.setForeground(new Color(255, 255, 204)); + lblBuySellRecycle.setFont(new Font("Sylfaen", Font.PLAIN, 28)); + lblBuySellRecycle.setBounds(99, 84, 431, 86); + contentPane.add(lblBuySellRecycle); + + JLabel label = new JLabel(""); + label.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\why-you-should-read-and-re-read-these-high-school-books-as-an-adult (Custom) (Custom).jpeg")); + label.setBounds(0, 25, 1008, 537); + contentPane.add(label); + + + } +} From 87ce17a2435af71ad1f5a84cb90bd0914d4504cf Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:11:47 +0530 Subject: [PATCH 115/121] Create Userlogin.java --- Userlogin.java | 295 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 Userlogin.java diff --git a/Userlogin.java b/Userlogin.java new file mode 100644 index 0000000..8f382ed --- /dev/null +++ b/Userlogin.java @@ -0,0 +1,295 @@ +package Textbook_selling_system; +/** + * + * @author Soumyadip Chowdhury + * @github soumyadip007 + * + */ +import java.awt.BorderLayout; + +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.border.EmptyBorder; + +import com.mysql.cj.jdbc.StatementWrapper; + +import javax.swing.ImageIcon; +import java.awt.Color; + +import java.sql.*; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.border.EmptyBorder; +import java.awt.Color; + +public class Userlogin extends JFrame { + + private JPanel contentPane; + private JTextField textField; + private JPasswordField passwordField; + private JButton btnNewButton; + private JButton btnNewButton_1; + private JButton btnNewButton_2; + private JButton btnNewButton_3; + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Userlogin frame = new Userlogin(); + + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Userlogin() { + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\0 (Custom).jpg")); + + setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\STDM.jpg")); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setBounds(450, 190, 1014, 597); + setResizable(false); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(null); + + JLabel lblNewLabel = new JLabel("User Login"); + lblNewLabel.setForeground(new Color(255, 255, 0)); + lblNewLabel.setFont(new Font("Times New Roman", Font.PLAIN, 46)); + lblNewLabel.setBounds(373, 42, 273, 93); + contentPane.add(lblNewLabel); + + textField = new JTextField(); + textField.setFont(new Font("Tahoma", Font.PLAIN, 32)); + textField.setBounds(481, 170, 281, 68); + contentPane.add(textField); + textField.setColumns(10); + + passwordField = new JPasswordField(); + passwordField.setFont(new Font("Tahoma", Font.PLAIN, 32)); + passwordField.setBounds(481, 286, 281, 68); + contentPane.add(passwordField); + + JLabel lblUsername = new JLabel("Username"); + lblUsername.setForeground(new Color(255, 255, 255)); + lblUsername.setFont(new Font("Tahoma", Font.PLAIN, 31)); + lblUsername.setBounds(204, 178, 193, 52); + contentPane.add(lblUsername); + + JLabel lblPassword = new JLabel("Password"); + lblPassword.setForeground(new Color(255, 255, 255)); + lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 31)); + lblPassword.setBounds(204, 294, 193, 52); + contentPane.add(lblPassword); + + btnNewButton = new JButton("Login"); + btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton.setBounds(481, 387, 113, 52); + btnNewButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int i=0,j=0; + String ustr=textField.getText(); + String pstr=passwordField.getText(); + + /* try{ + // String drivername="com.microsoft.sqlserver.jdbc.SQLServerDriver"; + // Class.forName("com.mysql.jdbc.Driver"); + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/book selling system","root",""); + //Statement st=con.createStatement(); + + String query="Select user1 from account"; + Statement sta=con.createStatement(); + // resultSet x=sta.executeUpdate(query); + while(x!=1) + { + + } + if(x==0) + { + JOptionPane.showMessageDialog(btnNewButton, "Wrong user namet"); + } + else + { + // JOptionPane.showMessageDialog(btnNewButton,"Welcome, "+msg+"Your account is sucessfully created"); + dispose(); + UserHost uh=new UserHost(); + uh.setTitle("Book Hub"); + uh.setVisible(true); + JOptionPane.showMessageDialog(btnNewButton, "You have successfully logged in"); + } + con.close(); + } + catch(Exception f) + { + System.out.println(f.getMessage()); + }*/ + /** for(i=0;i<2;i++) + { + + if(pass[i].equals(ustr)) + { + for(j=0;j<2;j++) + { + if(pass[i].equals(pstr)) + { + JOptionPane.showMessageDialog(btnNewButton, "You have successfully logged in"); + break; + } + } + } + } + if(i==2 && j==0) + { + + JOptionPane.showMessageDialog(btnNewButton, "Wrong Username"); + } + else if(j==2) + { + JOptionPane.showMessageDialog(btnNewButton, "Wrong Password"); + } + + if( ustr.equals("Soumya") && pstr.equals("1234")) + { + dispose(); + UserHost uh=new UserHost(); + uh.setTitle("Book Hub"); + uh.setVisible(true); + JOptionPane.showMessageDialog(btnNewButton, "You have successfully logged in"); + } + else + { + JOptionPane.showMessageDialog(btnNewButton, "Wrong Username & Password"); + } + /* try + { + String drivername="com.microsoft.sqlserver.jdbc.SQLServerDriver";//driver name + Class.forName(drivername); + String db="jdbc:sqlserver://PERSONAL\\SQLEXPRESS:1433;databaseName=test";//connection string + String user="sa"; + String pass="1234"; + Connection con=DriverManager.getConnection(db,user,pass); + + + + + Statement st=con.createStatement(); + ResultSet rs=st.executeQuery("SELECT uid,username,password FROM user WHERE username='"+ ustr +"' AND password='"+ pstr +"'"); + while(rs.next()) + { + dispose(); + AdminLogin al=new AdminLogin(); + al.setVisible(true); + } + + + + } + catch(Exception e1) + { + System.out.println(e1); + }*. + + + /*try{ + Class.forName("oracle.jdbc.driver.OracleDriver"); + Connection con=(Connection) DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","soumya","1234"); + String query="select * from tlogin where user_name='"+ustr+"' and password='"+pstr+"'"; + Statement st=con.createStatement(); + int x=st.executeUpdate(query); + if(x==1) + { + JOptionPane.showMessageDialog(btnNewButton, "This is alredy exist"); + } + con.close(); + } + catch(Exception f) + { + System.out.println(f); + } */ + } + }); + + contentPane.add(btnNewButton); + + btnNewButton_1 = new JButton("Admin Login"); + btnNewButton_1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + AdminLogin al=new AdminLogin(); + al.setTitle("Book Hub"); + al.setVisible(true); + } + }); + btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 30)); + btnNewButton_1.setBounds(204, 419, 216, 83); + contentPane.add(btnNewButton_1); + + btnNewButton_2 = new JButton("Create new account"); + btnNewButton_2.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton_2.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + Create_ac ca = new Create_ac(); + ca.setTitle("Book Hub"); + ca.setVisible(true); + } + }); + btnNewButton_2.setBounds(481, 470, 281, 52); + contentPane.add(btnNewButton_2); + + btnNewButton_3 = new JButton("Reset "); + btnNewButton_3.setFont(new Font("Tahoma", Font.PLAIN, 22)); + btnNewButton_3.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + } + }); + btnNewButton_3.setBounds(649, 387, 113, 52); + contentPane.add(btnNewButton_3); + + + JLabel label_1 = new JLabel(""); + label_1.setIcon(new ImageIcon("C:\\Users\\Soumyadeep\\Desktop\\Book Hub\\books-wallpaper-49796-51475-hd-wallpapers (Custom).jpg")); + label_1.setBounds(0, 0, 1008, 562); + contentPane.add(label_1); + + + } + +} From 97ee74ad97f4dae645d616e6e94a28bc90e408d9 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:12:19 +0530 Subject: [PATCH 116/121] Create index.html --- index.html | 294 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..0a937a2 --- /dev/null +++ b/index.html @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c8ef1171909dc039360ebb0fef9b2b85b9ae89d1 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:17:27 +0530 Subject: [PATCH 117/121] Update Jenkinsfile --- Jenkinsfile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 39a8d19..b8dce27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,17 +5,6 @@ pipeline { stage('Checkout') { steps { checkout scm - } - } - stage('SCM') { - steps { - // Checkout the code from Git - checkout([$class: 'GitSCM', - branches: [[name: '*/main']], - doGenerateSubmoduleConfigurations: false, - extensions: [], - submoduleCfg: [], - userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software.git']]]) } } @@ -26,9 +15,8 @@ pipeline { steps { script { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' - def mvn = tool 'mvn'; withSonarQubeEnv('bhushan') { - bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=bhushanJAVA -Dsonar.projectName='bhushanJAVA'" + bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" } } From 1613705441a328d7d70d6f08a4ef78111a97470f Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:19:27 +0530 Subject: [PATCH 118/121] Update sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 7cdbf72..86e5ed6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,7 +13,7 @@ sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list -sonar.java.binaries=**/*.class +#sonar.java.binaries=**/*.class #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test From ab60d8b995211028e85f5fb6017686cb3cf297d2 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:21:30 +0530 Subject: [PATCH 119/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 86e5ed6..c14c175 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,6 +17,6 @@ sonar.projectVersion=1.0 #sonar.exclusions=**/*.java #sonar.sources=src/main #sonar.tests=src/test -#sonar.sources=src/main/java -#sonar.java.binaries=./target/classes +sonar.sources=src/main/java +sonar.java.binaries=./target/classes #sonar.java.test.binaries=target/test-classes From 8dd0a9122ea5607ce68492709b41bb33d643ca44 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:23:17 +0530 Subject: [PATCH 120/121] Update Jenkinsfile --- Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b8dce27..39a8d19 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,17 @@ pipeline { stage('Checkout') { steps { checkout scm + } + } + stage('SCM') { + steps { + // Checkout the code from Git + checkout([$class: 'GitSCM', + branches: [[name: '*/main']], + doGenerateSubmoduleConfigurations: false, + extensions: [], + submoduleCfg: [], + userRemoteConfigs: [[url: 'https://github.com/BhushanShete/Java-JavaFx-Swing-Projects-Desktop-Application-GUI-Software.git']]]) } } @@ -15,8 +26,9 @@ pipeline { steps { script { def scannerHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + def mvn = tool 'mvn'; withSonarQubeEnv('bhushan') { - bat "C:\\SonarQube\\sonar-scanner-5.0.1.3006-windows\\bin\\sonar-scanner.bat" + bat "${mvn} clean verify sonar:sonar -Dsonar.projectKey=bhushanJAVA -Dsonar.projectName='bhushanJAVA'" } } From f1f2a89327794169e79cbfe48f974c0976c606d9 Mon Sep 17 00:00:00 2001 From: Bhushan Shrikant Shete <124190714+BhushanShete@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:30:50 +0530 Subject: [PATCH 121/121] Update sonar-project.properties --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index c14c175..240e638 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,8 +7,8 @@ sonar.sourceEncoding=UTF-8 sonar.token=sqa_e9713d073756a25f931823cc03b187d32fbcb47c # Project identification -sonar.projectKey=bhushanJAVA -sonar.projectName=bhushanJAVA +sonar.projectKey=java2 +sonar.projectName=java2 sonar.projectVersion=1.0 # Define multiple binary directories using a comma-separated list