From 6f4b58a700224b3865c3f425a4c93b40f522ccfb Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sat, 24 Jan 2026 17:07:15 +0530 Subject: [PATCH 1/6] Add Maven Central release workflow --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..135f0f8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release to Maven Central + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Set up JDK 8 + Maven Central + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '8' + + # Sonatype OSSRH (s01) + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + + # GPG signing + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Deploy to Sonatype + run: mvn clean deploy -P ossrh + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file From 62d03788f1370cf1cab989f212613a08bff6dacb Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sat, 24 Jan 2026 17:16:56 +0530 Subject: [PATCH 2/6] Fix Maven Central deployment configuration --- .github/workflows/release.yml | 2 +- pom.xml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 135f0f8..6bfd1f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: gpg-passphrase: GPG_PASSPHRASE - name: Deploy to Sonatype - run: mvn clean deploy -P ossrh + run: mvn clean deploy env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/pom.xml b/pom.xml index 0bab22d..5d08c88 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,19 @@ ${log4j2.version} + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots/ + + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + From 16d01d983addb4d43a92ff8b845cdcb01f037ab0 Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sat, 24 Jan 2026 17:30:30 +0530 Subject: [PATCH 3/6] Updated pom version --- .gitignore | 6 +++++- pom.xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5ff6309..429f44b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,8 @@ build/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store +/.idea/.gitignore +/.idea/encodings.xml +/.idea/misc.xml +/.idea/vcs.xml diff --git a/pom.xml b/pom.xml index 5d08c88..80d6284 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ in.org.nnm log4j2-utils - 1.0.8 + 1.0.2 From 0b72bcdb4a0e7d3a0c3a765bef0390ed44a735e6 Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sun, 25 Jan 2026 13:30:50 +0530 Subject: [PATCH 4/6] Updated pom & added ci workflow --- .github/workflows/ci.yml | 27 +++++++ .github/workflows/release.yml | 55 +++++++++----- pom.xml | 136 +++++++++++++++++++--------------- 3 files changed, 138 insertions(+), 80 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4a79861 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: Java CI Build + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + + - name: Build with Maven + run: mvn clean install -B \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6bfd1f3..1ce08f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,36 +1,51 @@ -name: Release to Maven Central +name: Maven Central Publish on: - push: - tags: - - 'v*' + release: + types: [published] jobs: - release: + publish: runs-on: ubuntu-latest + permissions: + contents: read steps: - - name: Checkout source + - name: Checkout Code uses: actions/checkout@v4 - - name: Set up JDK 8 + Maven Central + - name: Set up JDK 8 uses: actions/setup-java@v4 with: - distribution: 'temurin' java-version: '8' - - # Sonatype OSSRH (s01) - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD - - # GPG signing + distribution: 'temurin' + cache: 'maven' + server-id: central + server-username: CENTRAL_USERNAME + server-password: CENTRAL_PASSWORD gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE - - name: Deploy to Sonatype - run: mvn clean deploy + - name: Verify Version Match + run: | + POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + TAG_VERSION=${{ github.event.release.tag_name }} + # Remove 'v' prefix if you use tags like v1.0.0 + TAG_VERSION=${TAG_VERSION#v} + + echo "POM Version: $POM_VERSION" + echo "Tag Version: $TAG_VERSION" + + if [ "$POM_VERSION" != "$TAG_VERSION" ]; then + echo "Error: POM version ($POM_VERSION) does not match Tag ($TAG_VERSION)" + exit 1 + fi + + - name: Publish to Sonatype Central + run: | + mvn clean deploy -B \ + -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ + -DskipTests env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 80d6284..db6c986 100644 --- a/pom.xml +++ b/pom.xml @@ -4,24 +4,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + in.org.nnm + log4j2-utils + 1.0.0 + jar + log4j2-utils Utility helpers and extensions for Log4j2 configuration and usage https://github.com/Neel1210/log4j2-utils - - scm:git:https://github.com/Neel1210/log4j2-utils.git - scm:git:ssh://github.com/Neel1210/log4j2-utils.git - https://github.com/Neel1210/log4j2-utils - - - - Neelesh Mehar - 1210neelesh@gmail.com - - - - in.org.nnm - log4j2-utils - 1.0.2 @@ -31,12 +21,30 @@ + + + Neelesh Mehar + 1210neelesh@gmail.com + + + + + scm:git:https://github.com/Neel1210/log4j2-utils.git + scm:git:ssh://github.com/Neel1210/log4j2-utils.git + https://github.com/Neel1210/log4j2-utils + + + + GitHub Actions + https://github.com/Neel1210/log4j2-utils/actions + + - true + UTF-8 1.8 1.8 2.24.3 - UTF-8 + true @@ -47,29 +55,52 @@ - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots/ - - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + google_checks.xml + true + true + false + + + + validate + validate + + check + + + + org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources + package - jar + jar-no-fork @@ -81,6 +112,7 @@ attach-javadocs + package jar @@ -100,39 +132,23 @@ - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - - org.apache.logging.log4j - log4j-core - ${log4j2.version} - - + + --pinentry-mode + loopback + - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.1 - google_checks.xml - true - true - false - - - - validate - validate - - check - - - + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 + true + + central + true + published + From 1501ef0854a5d5c4dd733f467f11ac15780c2111 Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sun, 25 Jan 2026 13:42:14 +0530 Subject: [PATCH 5/6] Updated ci workflow --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a79861..a3c8b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,4 +24,6 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn clean install -B \ No newline at end of file + run: | + mvn clean install -B \ + -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file From 927755bc89cc454573c21a61504b9fa16190b763 Mon Sep 17 00:00:00 2001 From: Neelesh Date: Sun, 25 Jan 2026 13:51:57 +0530 Subject: [PATCH 6/6] skip gpg Signing ci workflow --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3c8b99..ed979ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,4 @@ jobs: - name: Build with Maven run: | - mvn clean install -B \ - -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file + mvn clean install -B -Dgpg.skip=true \ No newline at end of file