From 6887b0593596fc142472df0147c525e52884599f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Mon, 11 Sep 2023 11:52:45 +0200 Subject: [PATCH] Facelift for the upcoming `logging-parent` 10.0.0 --- .asf.yaml | 25 +- .editorconfig | 66 +++++ .gitattributes | 34 ++- .github/{dependabot.yml => dependabot.yaml} | 0 .github/workflows/build.yaml | 63 ++++ .github/workflows/build.yml | 210 -------------- .gitignore | 10 +- .mvn/jvm.config | 1 - .mvn/wrapper/maven-wrapper.properties | 4 +- CHANGELOG.adoc | 6 - LICENSE.txt | 2 +- NOTICE.txt | 5 + RELEASE-NOTES.md | 22 ++ RELEASING.adoc | 133 +++++---- log4j-transform-maven-plugin/pom.xml | 48 +++- .../src/doc/process-classes-mojo.adoc | 46 ++- .../src/it/location/pom.xml | 19 +- .../log4j/transform/maven/it/Main.java | 9 +- .../log4j/transform/maven/it/MainTest.java | 5 +- .../src/it/pomproject/pom.xml | 12 +- .../log4j/transform/maven/LocationMojo.java | 1 + .../maven/scan/ClassFileInclusionScanner.java | 5 +- .../maven/scan/SimpleInclusionScanner.java | 1 + .../pom.xml | 17 +- log4j-transform-parent/pom.xml | 166 +++-------- log4j-transform-perf/pom.xml | 17 ++ log4j-weaver/pom.xml | 20 ++ mvnw | 178 +++++++----- mvnw.cmd | 24 +- pom.xml | 272 +++++------------- spotless-license-header.txt | 16 ++ src/assembly/source-release.xml | 46 --- src/changelog/.changelog.md.ftl | 26 ++ src/changelog/.index.md.ftl | 22 ++ src/changelog/0.1.0/.release-notes.md.ftl | 22 ++ src/changelog/0.1.0/.release.xml | 2 +- ...rovide_Maven_plugin_to_inline_location.xml | 11 +- ...2-673_Maven_Shade_resource_transformer.xml | 14 +- src/changelog/0.2.0/.release-notes.md.ftl | 23 ++ src/changelog/0.2.0/.release.xml | 21 ++ src/changelog/CHANGELOG.adoc.ftl | 84 ------ 41 files changed, 775 insertions(+), 933 deletions(-) create mode 100644 .editorconfig rename .github/{dependabot.yml => dependabot.yaml} (100%) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/build.yml delete mode 100644 CHANGELOG.adoc create mode 100644 NOTICE.txt create mode 100644 RELEASE-NOTES.md create mode 100644 spotless-license-header.txt delete mode 100644 src/assembly/source-release.xml create mode 100644 src/changelog/.changelog.md.ftl create mode 100644 src/changelog/.index.md.ftl create mode 100644 src/changelog/0.1.0/.release-notes.md.ftl create mode 100644 src/changelog/0.2.0/.release-notes.md.ftl create mode 100644 src/changelog/0.2.0/.release.xml delete mode 100644 src/changelog/CHANGELOG.adoc.ftl diff --git a/.asf.yaml b/.asf.yaml index 5120251..c7c9e33 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -1,17 +1,19 @@ +# # Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with +# contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 +# The ASF licenses this file to you under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at +# the License. You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# # `.asf.yaml` documentation: https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features @@ -32,18 +34,3 @@ github: protected_branches: main: required_signatures: true - # Attempt to make the auto-generated github emails more easily readable in email clients. - custom_subjects: - new_pr: "[PR] {title} ({repository})" - close_pr: "Re: [PR] {title} ({repository})" - comment_pr: "Re: [PR] {title} ({repository})" - diffcomment: "Re: [PR] {title} ({repository})" - merge_pr: "Re: [PR] {title} ({repository})" - new_issue: "[I] {title} ({repository})" - comment_issue: "Re: [I] {title} ({repository})" - close_issue: "Re: [I] {title} ({repository})" - catchall: "[GH] {title} ({repository})" -notifications: - commits: commits@logging.apache.org - issues: notifications@logging.apache.org - pullrequests: notifications@logging.apache.org diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6c3d154 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Configuration here must match the one for Spotless in `pom.xml`! + +root = true + +[*] +indent_size = 4 +ij_continuation_indent_size = 8 +indent_style = space +trim_trailing_whitespace = true + +# `ij_any_use_relative_indents = true` is deliberately left out since it messes up the indentation in ternary operator usages + +# Split some things over multiple lines to keep lines short +ij_any_call_parameters_wrap = on_every_item +ij_any_method_parameters_wrap = on_every_item +ij_any_method_call_chain_wrap = on_every_item + +# Don't align with the first line to avoid single-line changes having an impact in the rest of the code +ij_any_align_multiline_parameters_in_calls = false +ij_any_align_multiline_parameters = false +ij_any_align_multiline_chained_methods = false + +# Only use `import *` when importing 5 or more +ij_java_names_count_to_use_import_on_demand = 5 +ij_java_class_count_to_use_import_on_demand = 5 + +# Order imports +# `*` denotes any packages except explicitly specified ones +# `|` denotes a blank line +# `$` denotes the prefix for static packages +# `**` means including subpackages +ij_java_imports_layout = java.**, |, javax.**, |, org.apache.logging.**, |, *, |, $java.**, |, $javax.**, |, $org.apache.logging.**, |, $* + +# Force curly braces +ij_any_for_brace_force = always +ij_any_if_brace_force = always +ij_any_do_while_brace_force = always +ij_any_while_brace_force = always + +# Don't align parameters and exceptions in javadoc based on the longest names to avoid single-line changes having an impact in the rest of the code +ij_java_doc_align_param_comments = false +ij_java_doc_align_exception_comments = false + +[*.{xml,xsd,properties,yml,yaml,json}] +indent_size = 2 + +[*.{md,adoc}] +indent_size = 2 +ij_any_wrap_long_lines = false +# The `no` value doesn't work in IntelliJ IDEA so a big number does the trick as well in most cases: +max_line_length = 9999 diff --git a/.gitattributes b/.gitattributes index cd39f9b..10914c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,14 +1,20 @@ -## -# Every file recognized as text should use LF -* text=auto eol=lf -# These are checked by Spotless -*.java text eol=lf -*.properties text eol=lf -*.xml text eol=lf -*.yaml text eol=lf -*.yml text eol=lf -# Maven Wrapper need LF line endings -/.mvn/wrapper/maven-wrapper.properties eol=lf -# Maven Wrapper scripts -/mvnw text eol=lf -/mvnw.cmd text eol=crlf +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Checked by Spotless (LF line endings) +*.java text eol=lf +*.xml text eol=lf +*.yaml text eol=lf +*.yml text eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..9b1b20e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,63 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: build + +on: + push: + # Avoid workflow run for _merged_ `dependabot` PRs. + # They were (hopefully!) already tested in PR-triggered workflow. + branches-ignore: + - "dependabot/**" + paths-ignore: + - "**.adoc" + - "**.md" + - "**.txt" + pull_request: + paths-ignore: + - "**.adoc" + - "**.md" + - "**.txt" + +permissions: read-all + +jobs: + + build: + uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main + # Write permissions to allow merge of `dependabot` PRs + permissions: + contents: write + pull-requests: write + + deploy-snapshot: + needs: build + if: github.repository == 'apache/logging-log4j-transform' && github.ref == 'refs/heads/main' + uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@main + secrets: inherit + + deploy-release: + needs: build + if: github.repository == 'apache/logging-log4j-transform' && startsWith(github.ref, 'refs/heads/release/') + uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@main + secrets: inherit + # Write permissions to allow the Maven `revision` property update, changelog release, etc. + permissions: + contents: write + with: + project-name: log4j-transform + distribution-attachment-count: 4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 267dfb5..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,210 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to you under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: build - -on: - push: - # Avoid workflow run for _merged_ `dependabot` PRs. - # They were (hopefully!) already tested in PR-triggered workflow. - branches-ignore: "dependabot/**" - pull_request: - paths-ignore: - - "**.adoc" - - "**.md" - - "**.txt" - -permissions: read-all - -jobs: - - build: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ macos-latest, ubuntu-latest, windows-latest ] - - steps: - - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 4.0.0 - - - name: Setup JDK 8 and 17 - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # 3.7.0 - with: - distribution: temurin - java-version: | - 8 - 17 - java-package: jdk - architecture: x64 - cache: maven - - # We could have used `verify`, but `clean install` is required while generating the build reproducibility report, which is performed in the next step. - # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility - - name: Build - shell: bash - run: | - ./mvnw \ - --show-version --batch-mode --errors --no-transfer-progress \ - -DtrimStackTrace=false \ - -DinstallAtEnd=true \ - -Pjava8-tests \ - clean install - - # `clean verify artifact:compare` is required to generate the build reproducibility report. - # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility - - name: Report build reproducibility - id: report-reproducible - timeout-minutes: 10 - shell: bash - run: | - ./mvnw \ - --show-version --batch-mode --errors --no-transfer-progress \ - -DskipTests=true \ - clean verify artifact:compare - - - name: Upload reproducibility failure context artifacts - if: failure() - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # 3.1.2 - with: - name: reproducibility-failure-context-${{matrix.os}} - path: | - **/target/*.buildcompare - **/target/*.jar - **/target/reference/*.jar - - merge: - - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' - needs: build - permissions: - contents: write - pull-requests: write - - steps: - - name: "[dependabot] Auto-merge the PR" - run: gh pr merge --auto --squash "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - deploy: - - runs-on: ubuntu-latest - needs: build - if: github.repository == 'apache/logging-log4j-transform' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) - permissions: - contents: write - - steps: - - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 4.0.0 - - - name: Set up Java & GPG - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # 3.7.0 - with: - distribution: temurin - java-version: 17 - java-package: jdk - architecture: x64 - cache: maven - server-id: ${{ github.ref == 'refs/heads/main' && 'apache.snapshots.https' || 'apache.releases.https' }} - server-username: NEXUS_USERNAME - server-password: NEXUS_PASSWORD - # We won't use `maven-gpg-plugin`, but this is convenient to import the GPG secret key - gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} - - - name: Export artifact version - run: | - export PROJECT_VERSION=$(./mvnw \ - --quiet --batch-mode -DforceStdout=true \ - -Dexpression=project.version \ - help:evaluate \ - | tail -n 1) - echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV - - - name: Check version (SNAPSHOT) - if: github.ref == 'refs/heads/main' - run: | - [[ "$PROJECT_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$ ]] || { - echo "was expecting a snapshot version, found: \"$PROJECT_VERSION\"" 1>&2 - exit 1 - } - - - name: Check version (RELEASE) - if: startsWith(github.ref, 'refs/heads/release/') - run: | - [[ "${GITHUB_REF/refs\/heads\/release\//}" == "$PROJECT_VERSION" ]] || { - echo "git ref \"$GITHUB_REF\" mismatches with the version: \"$PROJECT_VERSION\"" 1>&2 - exit 1 - } - [[ "$PROJECT_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { - echo "was expecting a release version, found: \"$PROJECT_VERSION\"" 1>&2 - exit 1 - } - export CHANGELOG_VERSION=$(grep "^= " CHANGELOG.adoc | head -n 1 | sed -r 's/^= (.+) \(.+\)$/\1/') - [[ "$PROJECT_VERSION" == "$CHANGELOG_VERSION" ]] || { - echo "version \"$PROJECT_VERSION\" doesn't match the one in changelog: \"$CHANGELOG_VERSION\"" 1>&2 - exit 1 - } - export EXPECTED_DATE=$(date --date="now + 3 days" +%Y-%m-%d) - export CHANGELOG_DATE=$(grep "^= " CHANGELOG.adoc | head -n 1 | sed -r 's/^= .+ \((.+)\)$/\1/') - [[ "$EXPECTED_DATE" == "$CHANGELOG_DATE" ]] || { - echo "expected release date \"$EXPECTED_DATE\" doesn't match the one in the changelog: \"$CHANGELOG_DATE\"" 1>&2 - exit 1 - } - - - name: Deploy - run: | - gpg --list-secret-keys - ./mvnw \ - --show-version --batch-mode --errors --no-transfer-progress \ - -P release - env: - # `NEXUS_USERNAME` and `NEXUS_PASSWORD` are used in `~/.m2/settings.xml` created by `setup-java` action - NEXUS_USERNAME: ${{ github.ref == 'refs/heads/main' && secrets.NEXUS_USER || secrets.LOGGING_STAGE_DEPLOYER_USER }} - NEXUS_PASSWORD: ${{ github.ref == 'refs/heads/main' && secrets.NEXUS_PW || secrets.LOGGING_STAGE_DEPLOYER_PW }} - # `SIGN_KEY` is used by `sign-maven-plugin` - SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }} - - - name: Sign artifacts (RELEASE) - if: startsWith(github.ref, 'refs/heads/release/') - run: | - gpg --armor --detach-sign --yes --pinentry-mode error "target/apache-log4j-transform-${PROJECT_VERSION}-src.zip" - - - name: Upload artifacts (RELEASE) - if: startsWith(github.ref, 'refs/heads/release/') - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # 3.1.2 - with: - name: Sources - path: target/apache-log4j-transform-*-src.zip* - if-no-file-found: error - - - name: Tag version (RELEASE) - if: startsWith(github.ref, 'refs/heads/release/') - run: | - export RCN=$[ $(git tag -l "rel/$PROJECT_VERSION[-.]rc*" | wc -l) + 1 ] - export TAG="rel/$PROJECT_VERSION-rc$RCN" - git config user.name github-actions - git config user.email github-actions@github.com - git tag "$TAG" -m "" - git push origin "$TAG" diff --git a/.gitignore b/.gitignore index 7a0958c..d67ee40 100644 --- a/.gitignore +++ b/.gitignore @@ -13,16 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -## Keep in sync with src/assembly/source-assembly.xml target/ -# IntelliJ IDEA .idea *.iml *.iws +/out +.flattened-pom.xml +/.mvn/wrapper/maven-wrapper.jar # Eclipse -.classpath .project +.classpath .settings/ -# Maven wrapper -/.mvn/wrapper/maven-wrapper.jar - diff --git a/.mvn/jvm.config b/.mvn/jvm.config index 8418f94..6f7d1c8 100644 --- a/.mvn/jvm.config +++ b/.mvn/jvm.config @@ -1,4 +1,3 @@ --Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5 -Djava.awt.headless=true --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index ca5ab4b..43a7228 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc deleted file mode 100644 index 91dde4e..0000000 --- a/CHANGELOG.adoc +++ /dev/null @@ -1,6 +0,0 @@ -= 0.1.0 (2023-05-05) - -== Added - -* https://issues.apache.org/jira/browse/LOG4J2-3638[LOG4J2-3638]: Add bytecode transformation tool to provide location information without reflection. (https://github.com/ppkarwasz[pkarwasz]) -* https://issues.apache.org/jira/browse/LOG4J2-673[LOG4J2-673]: Add resource transformer for the Maven Shade Plugin to merge `Log4j2Plugins.dat` plugin caches. Thanks to https://github.com/edwgiz[Eduard Gizatullin]. (https://github.com/ppkarwasz[pkarwasz]) diff --git a/LICENSE.txt b/LICENSE.txt index 6279e52..d645695 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 1999-2005 The Apache Software Foundation + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..a6e8c2b --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,5 @@ +Apache Log4j Tools +Copyright 2022-2023 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md new file mode 100644 index 0000000..a37d693 --- /dev/null +++ b/RELEASE-NOTES.md @@ -0,0 +1,22 @@ + + +This project uses itself, i.e., `log4j-changelog-maven-plugin`, for keeping a changelog and generating release notes. + +Changelog files are located under [`src/changelog`](src/changelog). +Release notes can be generated using `./mvnw -N -P changelog-export` command. +See [`log4j-changelog-maven-plugin`](log4j-changelog-maven-plugin) for details on how it all works. diff --git a/RELEASING.adoc b/RELEASING.adoc index 6de2578..20316ae 100644 --- a/RELEASING.adoc +++ b/RELEASING.adoc @@ -15,6 +15,25 @@ See the License for the specific language governing permissions and limitations under the License. //// +// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████ ██ +// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██ ██ +// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ +// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████ ██ +// +// Below instructions are shared by all Maven-based Apache Logging Services projects. +// Be extremely cautious while making changes! + +// Configuration /////////////////////////////////////////////////////////////// + +// Name of the GitHub repository; `logging-parent`, `logging-log4j2`, `logging-log4j-tools`, etc. +:repository-name: logging-log4j-transform + +// Name of the project; `logging-parent`, `log4j`, `log4j-tools` +:project-name: log4j-transform + +// Instructions //////////////////////////////////////////////////////////////// + = Release instructions [WARNING] @@ -22,90 +41,77 @@ limitations under the License. In the code examples below, assuming the version to be released is `7.8.0`. ==== -== Stage the release artifacts +== Stage the release -. Checkout the release branch: `git checkout -B release/7.8.0 origin/master` -. Perform and commit following changes: -.. Set the `revision` property to `7.8.0` in xref:pom.xml[`pom.xml`] -.. Set the `project.build.outputTimestamp` in xref:pom.xml[`pom.xml`] and xref:log4j-transform-parent/pom.xml[`log4j-transform-parent/pom.xml`] to the expected release date (72 hours from now) -.. Release and export the changelog: +. Create and push the release branch: + -[source,console] +[source,bash] ---- -./mvnw -N -Dlog4j.changelog.releaseVersion=0.1.0 log4j-changelog:release log4j-changelog:export +git fetch -p +git checkout -B release/7.8.0 origin/main +git push origin release/7.8.0 ---- -+ -. Make sure that `./mvnw clean verify` succeeds – if not, commit necessary fixes -. Push the `release/7.8.0` branch -. Make sure the associated https://github.com/apache/logging-log4j-tools/actions[GitHub Actions workflow] succeeds: +. Verify that the associated https://github.com/apache/{repository-name}/actions[GitHub Actions workflow] succeeds: +.. `revision` property in `pom.xml` is updated +.. Changelog is released (i.e., `src/changelog/7.8.0` folder is populated) .. *Signed artifacts* are uploaded to the _Staging Repositories_ in https://repository.apache.org/[repository.apache.org] -.. *Signed sources and their checksum* are uploaded as GitHub Actions workflow artifacts -.. `*rel/7.8.0-rc1*` git tag should be created -+ -[IMPORTANT] -==== -The ASF infrastructure treats ``rel/``-prefixed git tags special and ensures they are immutable for provenance reasons. -To make the above operation idempotent and allow retries, the release candidate enumeration used in the tag will be incremented automatically; `rel/7.8.0-rc1`, `rel/7.8.0-rc2`, etc. -==== +.. *Signed distribution and its checksum* (e.g., `apache-{project-name}-7.8.0-{bin,src}.{zip,.zip.asc,.zip.sha512}`) are uploaded to https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository (along with auxiliary files; email texts, etc.) + If not, commit necessary fixes, push, and repeat. + ++ +[TIP] +==== +GitHub Actions workflow is idempotent. +You can iterate on the `release/7.8.0` branch to perfect it. +==== . _Close_ the repository in https://repository.apache.org/[repository.apache.org] -. Commit _the signed sources and their checksum_ (e.g., `apache-log4j-transform-7.8.0-src.{zip,.zip.asc,.zip.sha512}`) to https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository and delete any artifacts from old releases == Vote the release -Collect release votes via email using the following template: - -.`[VOTE] Release Apache Log4j Transformation Tools 7.8.0` titled email to `dev@logging.apache.org` -[source] ----- -The Apache Log4j Transformation Tools 7.8.0 release is now available for voting. - -This release contains minor enhancements and bug fixes. - -Source repository: https://github.com/apache/logging-log4j-transform -Tag: rel/7.8.0-rc1 -Commit: e82a44142280d013bd76ea18951fde00dcee192b -Artifacts: https://dist.apache.org/repos/dist/dev/logging/log4j/ -Nexus repository: https://repository.apache.org/content/repositories/orgapachelogging-1096 -Signing key: https://keyserver.ubuntu.com/pks/lookup?search=077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0&fingerprint=on&op=index - -Please download, test, and cast your votes on the Log4j developers list. - -[ ] +1, release the artifacts -[ ] -1, don't release, because... - -The vote will remain open for 72 hours (or more if required). All votes are welcome and we encourage everyone to test the release, but only the Logging Services PMC votes are officially counted. At least 3 +1 votes and more positive than negative votes are required. ----- - +. Send the vote email uploaded to the https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository ++ +[WARNING] +==== +**Fix the cited https://repository.apache.org[repository.apache.org] URL** in the generated email! +It changes after every Nexus deployment. +==== ++ [WARNING] ==== Make sure your email is sent in plain text, that is, https://infra.apache.org/contrib-email-tips#nohtml[no HTML]! If you are using GMail, simply enable the _"Plain text mode"_ while composing your message. ==== -Once the consensus is reached within the set time frame, respond to the first post in the thread as follows: - +. Once the consensus is reached within the set time frame, respond to the first post in the thread as follows: ++ [source] ---- Adding my +1. -With that, the release passes with 3 binding +1 votes from A, B and me. +With that, the release passes with 3 binding +1 votes from , ..., , and me. +I will continue the release process. ---- == Publish the release -=== In git repository +=== In the git repository . Pull the most recent changes and tags . Tag the release (e.g., `rel/7.8.0`) and push it + +[source,bash] +---- +git tag -a rel/7.8.0 -m 7.8.0 +git push origin rel/7.8.0 +---- ++ [IMPORTANT] ==== The ASF infrastructure treats ``rel/``-prefixed git tags special and ensures they are immutable for provenance reasons. ==== -. Merge `release/7.8.0` changes to `main` +. Merge `release/7.8.0` to `main` . Set the revision property to the next development version (e.g., `7.9.0-SNAPSHOT`) in xref:pom.xml[`pom.xml`] . Commit changes and push the `main` branch . Delete the local and remote copies of the `release/7.8.0` branch @@ -113,24 +119,25 @@ The ASF infrastructure treats ``rel/``-prefixed git tags special and ensures the === In the ASF infrastructure . _Release_ the repository in https://reporter.apache.org/addrelease.html?logging[repository.apache.org] -. In https://dist.apache.org/repos/dist/release/logging/log4j[dist.apache.org/repos/dist] Subversion repository, -.. move the signed sources and their checksum from `*dev*/logging/log4j` directory to `*release*/logging/log4j-tools/7.8.0` -.. delete the folder from an earlier release in `*release*/logging/log4j-tools` +. In https://dist.apache.org/repos/dist/release/logging/{project-name}[dist.apache.org/repos/dist] Subversion repository, +.. create the `*release*/logging/{project-name}/7.8.0` folder, and copy the signed sources and their checksum from `*dev*/logging/{project-name}` to there +.. delete the folder from an earlier release in `*release*/logging/{project-name}` .. commit changes . Report the release at https://reporter.apache.org/[reporter.apache.org] === In GitHub -Once the artifacts are visible in https://central.sonatype.dev/[central.sonatype.dev], https://github.com/apache/logging-log4j-tools/releases/new[create a new release in GitHub] +Once the artifacts are visible in https://central.sonatype.dev/[central.sonatype.dev], https://github.com/apache/{repository-name}/releases/new[create a new release in GitHub] . Use the `rel/7.8.0` tag -. Copy necessary changes from xref:CHANGELOG.adoc[`CHANGELOG.adoc`] -.. formatting needs to be converted from AsciiDoc to https://github.github.com/gfm/[GitHub Flavored Markdown] -.. GitHub Issue links need to be converted from -+ -[source] ----- -https://github.com/apache/logging-log4j-transform/issues/19[#19] ----- +. Copy release notes from the generated emails + +== Announce the release + +. Send the announcement email uploaded to the https://dist.apache.org/repos/dist/dev/logging/{project-name}[dist.apache.org/repos/dist/**dev**/logging/{project-name}] Subversion repository + -AsciiDoc-formatted links to simply `#19` +[WARNING] +==== +Make sure your email is sent in plain text, that is, https://infra.apache.org/contrib-email-tips#nohtml[no HTML]! +If you are using GMail, simply enable the _"Plain text mode"_ while composing your message. +==== diff --git a/log4j-transform-maven-plugin/pom.xml b/log4j-transform-maven-plugin/pom.xml index ec506f8..89aea7a 100644 --- a/log4j-transform-maven-plugin/pom.xml +++ b/log4j-transform-maven-plugin/pom.xml @@ -16,44 +16,57 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging.log4j log4j-transform-parent ${revision} ../log4j-transform-parent + log4j-transform-maven-plugin maven-plugin + Apache Log4j Transform Maven plugin The Apache Log4j Transform Maven plugin + + org.apache.logging.log4j log4j-weaver + org.codehaus.plexus plexus-utils + org.apache.maven maven-core provided + org.apache.maven.plugin-tools maven-plugin-annotations provided + org.apache.maven maven-plugin-api provided + + + org.apache.felix maven-bundle-plugin @@ -61,26 +74,27 @@ true + org.apache.maven.plugins maven-invoker-plugin - - ${project.build.directory}/its - ${project.build.directory}/it-repo - - clean verify - - + invoke-its install integration-test verify + integration-test + + ${project.build.directory}/its + ${project.build.directory}/it-repo + + org.apache.maven.plugins maven-jar-plugin @@ -93,6 +107,7 @@ + org.apache.maven.plugins maven-plugin-plugin @@ -100,6 +115,25 @@ log4j-transform + + + + + + + invoker-toggle + + + skipTests + + + + true + + + + + diff --git a/log4j-transform-maven-plugin/src/doc/process-classes-mojo.adoc b/log4j-transform-maven-plugin/src/doc/process-classes-mojo.adoc index a353573..b310e23 100644 --- a/log4j-transform-maven-plugin/src/doc/process-classes-mojo.adoc +++ b/log4j-transform-maven-plugin/src/doc/process-classes-mojo.adoc @@ -14,67 +14,57 @@ // See the License for the specific language governing permissions and // limitations under the License. // -= log4j-transform:process-classes += `log4j-transform:process-classes` -*Full name*: +Full name:: -org.apache.logging.log4j:log4j-transform-maven-plugin:0.1.0:process-classes +`org.apache.logging.log4j:log4j-transform-maven-plugin:0.1.0:process-classes` -*Description*: +Description:: -Generates static location information of Log4j 2.x API calls in the project classes. The resulting bytecode will no rely on runtime resolution of location information. +Generates static location information of Log4j 2.x API calls in the project classes. +The resulting bytecode will not rely on runtime resolution of the location information. -*Attributes*: +Attributes:: - * Requires a Maven project to be executed. - * Requires dependency resolution of artifacts in scope: compile. - * The goal is thread-safe and supports parallel builds. + * Requires a Maven project to be executed + * Requires dependency resolution of artifacts in scope: `compile` + * The goal is thread-safe and supports parallel builds * Binds by default to the http://maven.apache.org/ref/current/maven-core/lifecycles.html[lifecycle phase]: `process-classes`. == Required Parameters -[cols="1,1,1,10"] +[cols="3,3,10"] |=== -|Name|Type|Since|Description +|Name|Type|Description |`` |`File` -|- | The directory containing classes to be processed. - -*Default value*: `${project.build.outputDirectory}` +It defaults to `${project.build.outputDirectory}`. |`` |`File` -|- | The directory where woven classes will be written. - -*Default value*; `${project.build.outputDirectory}` +It defaults to `${project.build.outputDirectory}`. |=== == Optional Parameters -[cols="1,1,1,10"] +[cols="3,3,10"] |=== -|Name|Type|Since|Description +|Name|Type|Description |`` |`List` -|- | Files to include. If empty all class files will be processed. |`` |`List` -|- | Files to exclude. |`` |`int` -|- -| Sets the granularity in milliseconds of the last modification date for testing whether a class file needs weaving. - -*Default value is*: `0`. - -*User property is*: `lastModGranularityMs`. - +| Sets the granularity in milliseconds of the last modification date for testing if a class file needs weaving. +It defaults to `0` and can be configured using the `lastModGranularityMs` property. |=== diff --git a/log4j-transform-maven-plugin/src/it/location/pom.xml b/log4j-transform-maven-plugin/src/it/location/pom.xml index e6a106a..27ea6e4 100644 --- a/log4j-transform-maven-plugin/src/it/location/pom.xml +++ b/log4j-transform-maven-plugin/src/it/location/pom.xml @@ -16,25 +16,29 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging logging-parent - 9 + 10.0.0-SNAPSHOT + org.apache.logging.log4j.maven.it log4j-maven-it-location @project.version@ jar - Apache Log4j Maven plugin test - The Apache Log4j Maven plugin test + 5.9.3 2.20.0 + + org.junit junit-bom @@ -42,6 +46,7 @@ pom import + org.apache.logging.log4j log4j-bom @@ -50,23 +55,30 @@ import + + + org.apache.logging.log4j log4j-api + org.apache.logging.log4j log4j-core runtime + org.junit.jupiter junit-jupiter-api test + + @@ -83,4 +95,5 @@ + diff --git a/log4j-transform-maven-plugin/src/it/location/src/main/java/org/apache/logging/log4j/transform/maven/it/Main.java b/log4j-transform-maven-plugin/src/it/location/src/main/java/org/apache/logging/log4j/transform/maven/it/Main.java index ff429c8..cdc6ff9 100644 --- a/log4j-transform-maven-plugin/src/it/location/src/main/java/org/apache/logging/log4j/transform/maven/it/Main.java +++ b/log4j-transform-maven-plugin/src/it/location/src/main/java/org/apache/logging/log4j/transform/maven/it/Main.java @@ -21,15 +21,16 @@ public class Main implements Runnable { - private static final Logger logger = LogManager.getLogger(); + private static final Logger LOGGER = LogManager.getLogger(); public static void main(String[] args) { - logger.info("Application starts"); + LOGGER.info("Application starts"); new Main().run(); - logger.info("Application stops"); + LOGGER.info("Application stops"); } public void run() { - logger.info("Another log message"); + LOGGER.info("Another log message"); } + } diff --git a/log4j-transform-maven-plugin/src/it/location/src/test/java/org/apache/logging/log4j/transform/maven/it/MainTest.java b/log4j-transform-maven-plugin/src/it/location/src/test/java/org/apache/logging/log4j/transform/maven/it/MainTest.java index fd4e97b..9fd886c 100644 --- a/log4j-transform-maven-plugin/src/it/location/src/test/java/org/apache/logging/log4j/transform/maven/it/MainTest.java +++ b/log4j-transform-maven-plugin/src/it/location/src/test/java/org/apache/logging/log4j/transform/maven/it/MainTest.java @@ -18,12 +18,13 @@ import org.junit.jupiter.api.Test; -public class MainTest { +class MainTest { private static final String[] ARGS = {"Hello", "Log4j2"}; @Test - public void testDoesNotThrow() { + void testDoesNotThrow() { Main.main(ARGS); } + } diff --git a/log4j-transform-maven-plugin/src/it/pomproject/pom.xml b/log4j-transform-maven-plugin/src/it/pomproject/pom.xml index 14ff1a2..3cfbba4 100644 --- a/log4j-transform-maven-plugin/src/it/pomproject/pom.xml +++ b/log4j-transform-maven-plugin/src/it/pomproject/pom.xml @@ -16,22 +16,21 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging logging-parent - 9 + 10.0.0-SNAPSHOT + org.apache.logging.log4j.maven.it log4j-maven-it-pomproject @project.version@ pom - Apache Log4j Maven plugin test - The Apache Log4j Maven plugin test - - 2.20.0 - + @@ -48,4 +47,5 @@ + diff --git a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java index 97af70c..1a96f8a 100644 --- a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java +++ b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java @@ -221,4 +221,5 @@ private ClassLoader getProjectDependencies() throws MojoExecutionException { } return new URLClassLoader(urls.toArray(EMPTY_URL_ARRAY)); } + } diff --git a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/ClassFileInclusionScanner.java b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/ClassFileInclusionScanner.java index 73e90a1..16cc095 100644 --- a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/ClassFileInclusionScanner.java +++ b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/ClassFileInclusionScanner.java @@ -23,8 +23,8 @@ public interface ClassFileInclusionScanner { - static final String DEFAULT_INCLUSION_PATTERN = "**/*.class"; - static final String DEFAULT_EXCLUSION_PATTERN = "**/*" + Constants.LOCATION_CACHE_SUFFIX + ".class"; + String DEFAULT_INCLUSION_PATTERN = "**/*.class"; + String DEFAULT_EXCLUSION_PATTERN = "**/*" + Constants.LOCATION_CACHE_SUFFIX + ".class"; /** * Finds class files matching a specific condition. @@ -34,4 +34,5 @@ public interface ClassFileInclusionScanner { * @return a set of relative paths to file in {@code sourceDir} */ Set getIncludedClassFiles(Path sourceDir, Path targetDir); + } diff --git a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/SimpleInclusionScanner.java b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/SimpleInclusionScanner.java index bbaa7d3..0b86bc6 100644 --- a/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/SimpleInclusionScanner.java +++ b/log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/scan/SimpleInclusionScanner.java @@ -90,4 +90,5 @@ private boolean isLocationCacheStale(Path sourceDir, Path targetDir, Path source } return false; } + } diff --git a/log4j-transform-maven-shade-plugin-extensions/pom.xml b/log4j-transform-maven-shade-plugin-extensions/pom.xml index 3a389f8..64fb904 100644 --- a/log4j-transform-maven-shade-plugin-extensions/pom.xml +++ b/log4j-transform-maven-shade-plugin-extensions/pom.xml @@ -16,31 +16,34 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging.log4j log4j-transform-parent ${revision} ../log4j-transform-parent + log4j-transform-maven-shade-plugin-extensions jar + Apache Log4j Maven Shade Plugin Transformer Transformer implementation to concatenate Log4j2Plugins.dat files - - Shaded Plugin Log4j2 Transformer - true - + commons-io commons-io + org.apache.logging.log4j log4j-api + org.apache.logging.log4j log4j-core @@ -49,15 +52,18 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.5.0 provided + org.junit.jupiter junit-jupiter-engine test + + @@ -105,4 +111,5 @@ + diff --git a/log4j-transform-parent/pom.xml b/log4j-transform-parent/pom.xml index 764cba2..14b287f 100644 --- a/log4j-transform-parent/pom.xml +++ b/log4j-transform-parent/pom.xml @@ -16,49 +16,45 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging.log4j log4j-transform-bom ${revision} + log4j-transform-parent pom + - - UTF-8 - UTF-8 - UTF-8 - - 1683307797 - - true - true + 9.5 3.24.2 - 3.12.0 + 3.13.0 1.2 - 2.11.0 - 2.3.32 + 2.13.0 1.37 5.10.0 2.20.0 3.6.3 - 3.5.1 + 4.0.0 2.0.9 4.7.3 + 5.1.8 - 2.21.1 0.8.10 - 1.12.0 3.5.1 - 4.7.3.5 3.0.0-M7 + + + org.ow2.asm asm-bom @@ -66,6 +62,7 @@ pom import + org.junit junit-bom @@ -73,6 +70,7 @@ pom import + org.apache.logging.log4j log4j-bom @@ -80,197 +78,96 @@ pom import + org.assertj assertj-core ${assertj.version} + commons-io commons-io ${commons-io.version} + org.apache.commons commons-lang3 ${commons-lang.version} + commons-logging commons-logging ${commons-logging.version} - - org.freemarker - freemarker - ${freemarker.version} - + org.openjdk.jmh jmh-core ${jmh.version} + org.apache.maven maven-core ${maven.version} + org.apache.maven maven-plugin-api ${maven.version} + org.codehaus.plexus plexus-utils ${plexus-utils.version} + org.slf4j slf4j-api ${slf4j.version} + com.github.spotbugs spotbugs-annotations ${spotbugs.version} + + + org.jacoco jacoco-maven-plugin ${jacoco-maven-plugin.version} + org.apache.felix maven-bundle-plugin ${bundle-plugin.version} + org.apache.maven.plugins maven-invoker-plugin ${maven-invoker-plugin.version} - - com.github.spotbugs - spotbugs-maven-plugin - ${spotbugs-maven-plugin.version} - + - - - - org.apache.rat - apache-rat-plugin - - true - - **/target/** - .java-version - src/main/resources/META-INF/MANIFEST.MF - - - - - - check - - verify - - - - - - org.codehaus.mojo - flatten-maven-plugin - ${flatten-maven-plugin.version} - - true - resolveCiFriendliesOnly - - - - flatten-revision - - flatten - - process-resources - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${project.build.sourceEncoding} - - -Xlint:all - -XDcompilePolicy=simple - -Xplugin:ErrorProne - - - - com.google.errorprone - error_prone_core - ${error-prone.version} - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-upper-bound-deps - - enforce - - - - - - - - - - - - com.github.spotbugs - spotbugs-maven-plugin - - - - com.h3xstream.findsecbugs - findsecbugs-plugin - ${findsecbugs-plugin.version} - - - - - - default-spotbugs - - check - - verify - - - - + java8-tests @@ -292,4 +189,5 @@ + diff --git a/log4j-transform-perf/pom.xml b/log4j-transform-perf/pom.xml index 8119b2f..ea9017d 100644 --- a/log4j-transform-perf/pom.xml +++ b/log4j-transform-perf/pom.xml @@ -16,42 +16,55 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging.log4j log4j-transform-parent ${revision} ../log4j-transform-parent + log4j-transform-perf + Log4j Transformation Tools Performance test Performance tests for Apache Log4j Transformation Tools + true true true + + org.openjdk.jmh jmh-core + org.apache.logging.log4j log4j-api + org.apache.logging.log4j log4j-core + com.github.spotbugs spotbugs-annotations provided + + + org.apache.logging.log4j log4j-transform-maven-plugin @@ -68,6 +81,7 @@ + org.apache.maven.plugins maven-compiler-plugin @@ -91,6 +105,7 @@ + org.apache.maven.plugins maven-shade-plugin @@ -142,6 +157,8 @@ + + diff --git a/log4j-weaver/pom.xml b/log4j-weaver/pom.xml index 9fbe6c3..cf5052a 100644 --- a/log4j-weaver/pom.xml +++ b/log4j-weaver/pom.xml @@ -16,74 +16,93 @@ ~ limitations under the License. --> + 4.0.0 + org.apache.logging.log4j log4j-transform-parent ${revision} ../log4j-transform-parent + log4j-weaver + Apache Log4j Weaving Tools The Apache Log4j Weaving Tools for logging frameworks + + org.ow2.asm asm + org.ow2.asm asm-commons + org.ow2.asm asm-util + org.apache.commons commons-lang3 + com.github.spotbugs spotbugs-annotations provided + org.assertj assertj-core test + commons-logging commons-logging test + org.junit.jupiter junit-jupiter-api test + org.junit.jupiter junit-jupiter-engine test + org.apache.logging.log4j log4j-api test + org.apache.logging.log4j log4j-api-test test + org.apache.logging.log4j log4j-core-test test + + @@ -92,4 +111,5 @@ + diff --git a/mvnw b/mvnw index c96ef80..af46563 100755 --- a/mvnw +++ b/mvnw @@ -19,7 +19,7 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.1.1 +# Apache Maven Wrapper startup batch script, version 3.2.0 # # Required ENV vars: # ------------------ @@ -53,7 +53,7 @@ fi cygwin=false; darwin=false; mingw=false -case "`uname`" in +case "$(uname)" in CYGWIN*) cygwin=true ;; MINGW*) mingw=true;; Darwin*) darwin=true @@ -61,7 +61,7 @@ case "`uname`" in # See https://developer.apple.com/library/mac/qa/qa1170/_index.html if [ -z "$JAVA_HOME" ]; then if [ -x "/usr/libexec/java_home" ]; then - JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME else JAVA_HOME="/Library/Java/Home"; export JAVA_HOME fi @@ -71,38 +71,38 @@ esac if [ -z "$JAVA_HOME" ] ; then if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` + JAVA_HOME=$(java-config --jre-home) fi fi # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") fi # For Mingw, ensure paths are in UNIX format before anything is touched if $mingw ; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" fi if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" else - javaExecutable="`readlink -f \"$javaExecutable\"`" + javaExecutable="$(readlink -f "\"$javaExecutable\"")" fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') JAVA_HOME="$javaHome" export JAVA_HOME fi @@ -118,7 +118,7 @@ if [ -z "$JAVACMD" ] ; then JAVACMD="$JAVA_HOME/bin/java" fi else - JAVACMD="`\\unset -f command; \\command -v java`" + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" fi fi @@ -150,108 +150,99 @@ find_maven_basedir() { fi # workaround for JBEAP-8937 (on Solaris 10/Sparc) if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` + wdir=$(cd "$wdir/.." || exit 1; pwd) fi # end of workaround done - printf '%s' "$(cd "$basedir"; pwd)" + printf '%s' "$(cd "$basedir" || exit 1; pwd)" } # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" fi } -BASE_DIR=$(find_maven_basedir "$(dirname $0)") +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") if [ -z "$BASE_DIR" ]; then exit 1; fi MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi +log "$MAVEN_PROJECTBASEDIR" ########################################################################################## # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central # This allows using the maven wrapper in projects that prohibit checking in binary data. ########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi + log "Couldn't find $wrapperJarPath, downloading it ..." + if [ -n "$MVNW_REPOURL" ]; then - wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" else - wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;; + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $wrapperUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") fi if command -v wget > /dev/null; then - QUIET="--quiet" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - QUIET="" - fi + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" else - wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" fi - [ $? -eq 0 ] || rm -f "$wrapperJarPath" elif command -v curl > /dev/null; then - QUIET="--silent" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - QUIET="" - fi + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" else - curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" fi - [ $? -eq 0 ] || rm -f "$wrapperJarPath" else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" # For Cygwin, switch paths to Windows format before running javac if $cygwin; then - javaSource=`cygpath --path --windows "$javaSource"` - javaClass=`cygpath --path --windows "$javaClass"` + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") fi if [ -e "$javaSource" ]; then if [ ! -e "$javaClass" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class + log " - Compiling MavenWrapperDownloader.java ..." ("$JAVA_HOME/bin/javac" "$javaSource") fi if [ -e "$javaClass" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" fi fi fi @@ -260,28 +251,57 @@ fi # End of extension ########################################################################################## +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") fi # Provide a "standardized" way to retrieve the CLI args that will # work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" export MAVEN_CMD_LINE_ARGS WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - LINE_SEPARATOR=" " +# shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ diff --git a/mvnw.cmd b/mvnw.cmd index 58f5237..3cb089f 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -18,7 +18,7 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.1.1 +@REM Apache Maven Wrapper startup batch script, version 3.2.0 @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @@ -119,7 +119,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain -set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B @@ -133,7 +133,7 @@ if exist %WRAPPER_JAR% ( ) ) else ( if not "%MVNW_REPOURL%" == "" ( - SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" ) if "%MVNW_VERBOSE%" == "true" ( echo Couldn't find %WRAPPER_JAR%, downloading it ... @@ -153,6 +153,24 @@ if exist %WRAPPER_JAR% ( ) @REM End of extension +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + @REM Provide a "standardized" way to retrieve the CLI args that will @REM work with both Windows and non-Windows executions. set MAVEN_CMD_LINE_ARGS=%* diff --git a/pom.xml b/pom.xml index 63f7747..d1757fe 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,7 @@ ~ limitations under the License. --> + + 4.0.0 + org.apache.logging logging-parent - 9 + 10.0.0-SNAPSHOT + org.apache.logging.log4j log4j-transform-bom ${revision} pom + https://github.com/apache/logging-log4j-transform + 2022 - - Apache Software Foundation - https://apache.org - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - + + pkarwasz Piotr P. Karwasz @@ -58,112 +54,101 @@ Europe/Warsaw + + + vy + Volkan Yazıcı + vy@apache.org + + PMC Member + + Europe/Amsterdam + + + + log4j-transform-parent + + log4j-transform-maven-plugin - log4j-weaver log4j-transform-maven-shade-plugin-extensions + log4j-weaver + + scm:git:git@github.com:apache/logging-log4j-transform.git scm:git:git@github.com:apache/logging-log4j-transform.git HEAD https://github.com/apache/logging-log4j-transform + GitHub Issues https://github.com/apache/logging-log4j-transform/issues + GitHub Actions https://github.com/apache/logging-log4j-transform/actions - - - - + + - 0.1.1-SNAPSHOT - - [17,18) - 8 - - 1683307797 - - 1.11 - 1.5.0 - 0.3.0 - 1.0.1 + 0.2.0-SNAPSHOT + + + true + true + + + org.apache.logging.log4j log4j-transform-maven-plugin ${project.version} + + + org.apache.logging.log4j + log4j-transform-maven-shade-plugin-extensions + ${project.version} + + org.apache.logging.log4j log4j-weaver ${project.version} + + + + + + apache.snapshots.https + ${distMgmtSnapshotsName} + https://repository.apache.org/content/repositories/snapshots + + + - - - - org.codehaus.mojo - flatten-maven-plugin - ${flatten-maven-plugin.version} - - - ${project.build.directory} - - - - org.apache.logging.log4j - log4j-changelog-maven-plugin - ${log4j-changelog-maven-plugin.version} - - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 3.0.0 - - true - clean spotless:apply verify - - - - - + + org.codehaus.mojo flatten-maven-plugin - false + ${flatten-maven-plugin.version} flatten-bom @@ -171,130 +156,27 @@ flatten process-resources + false + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-no-snapshots - bom - - - remove - remove - remove - interpolate - + true + - - - release - - true - - - deploy - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - source-release-assembly - - single - - package - - true - apache-log4j-transform-${project.version} - true - - src/assembly/source-release.xml - - - - - - - - net.nicoulaj.maven.plugins - checksum-maven-plugin - 1.11 - false - - - source-release-checksum - - files - - - post-integration-test - - - SHA-512 - - false - - - ${project.build.directory} - - apache-log4j-transform* - - - - - - - - - - org.simplify4u.plugins - sign-maven-plugin - ${sign-maven-plugin.version} - - - default-sign - - sign - - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - true - - true - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - - - - + diff --git a/spotless-license-header.txt b/spotless-license-header.txt new file mode 100644 index 0000000..4f33236 --- /dev/null +++ b/spotless-license-header.txt @@ -0,0 +1,16 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ diff --git a/src/assembly/source-release.xml b/src/assembly/source-release.xml deleted file mode 100644 index 824c79a..0000000 --- a/src/assembly/source-release.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - src - - zip - - - - true - ${project.basedir} - - - **/target/** - .idea/** - **/*.iml - **/*.iws - **/.classpath - **/.project - **/.settings/** - .mvn/wrapper/maven-wrapper.jar - - .asf.yaml - .git/** - .github/** - .gitattributes - .gitignore - - - - diff --git a/src/changelog/.changelog.md.ftl b/src/changelog/.changelog.md.ftl new file mode 100644 index 0000000..7a5b094 --- /dev/null +++ b/src/changelog/.changelog.md.ftl @@ -0,0 +1,26 @@ +<#-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to you under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<#if entriesByType?size gt 0>## Changes +<#list entriesByType as entryType, entries> + +### ${entryType?capitalize} + +<#list entries as entry> +* ${entry.description.text?replace("\\s+", " ", "r")}<#if entry.issues?has_content> (<#list entry.issues as issue><#if issue.link?starts_with("https://github.com/apache/logging-parent")>#${issue.id}<#else>[${issue.id}](${issue.link})<#if issue?has_next>, ) + + + diff --git a/src/changelog/.index.md.ftl b/src/changelog/.index.md.ftl new file mode 100644 index 0000000..693f1f8 --- /dev/null +++ b/src/changelog/.index.md.ftl @@ -0,0 +1,22 @@ +<#-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to you under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +# Release Notes + +<#list releases as release> +* [${release.version}](${release.version}.md)<#if release.date?has_content> (${release.date}) + diff --git a/src/changelog/0.1.0/.release-notes.md.ftl b/src/changelog/0.1.0/.release-notes.md.ftl new file mode 100644 index 0000000..89bb2c3 --- /dev/null +++ b/src/changelog/0.1.0/.release-notes.md.ftl @@ -0,0 +1,22 @@ +<#-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to you under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +# ${release.version}<#if release.date?has_content> (${release.date}) + +This is the first release of the project. + +<#include "../.changelog.md.ftl"> diff --git a/src/changelog/0.1.0/.release.xml b/src/changelog/0.1.0/.release.xml index 42b5807..f51cb70 100644 --- a/src/changelog/0.1.0/.release.xml +++ b/src/changelog/0.1.0/.release.xml @@ -17,5 +17,5 @@ --> diff --git a/src/changelog/0.1.0/LOG4J2-3638_Provide_Maven_plugin_to_inline_location.xml b/src/changelog/0.1.0/LOG4J2-3638_Provide_Maven_plugin_to_inline_location.xml index 34e1f8a..14ada66 100644 --- a/src/changelog/0.1.0/LOG4J2-3638_Provide_Maven_plugin_to_inline_location.xml +++ b/src/changelog/0.1.0/LOG4J2-3638_Provide_Maven_plugin_to_inline_location.xml @@ -15,10 +15,11 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + - - - Add bytecode transformation tool to provide location information without reflection. - + + Added `log4j-transform-maven-plugin` bytecode transformation tool to provide location information without reflection diff --git a/src/changelog/0.1.0/LOG4J2-673_Maven_Shade_resource_transformer.xml b/src/changelog/0.1.0/LOG4J2-673_Maven_Shade_resource_transformer.xml index aa19505..5cde8f4 100644 --- a/src/changelog/0.1.0/LOG4J2-673_Maven_Shade_resource_transformer.xml +++ b/src/changelog/0.1.0/LOG4J2-673_Maven_Shade_resource_transformer.xml @@ -15,12 +15,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + - - - - - Add resource transformer for the Maven Shade Plugin to merge `Log4j2Plugins.dat` plugin caches. - + + + Added `log4j-transform-maven-shade-plugin-extensions` resource transformer for the Maven Shade Plugin to merge `Log4j2Plugins.dat` plugin caches diff --git a/src/changelog/0.2.0/.release-notes.md.ftl b/src/changelog/0.2.0/.release-notes.md.ftl new file mode 100644 index 0000000..62bcbfa --- /dev/null +++ b/src/changelog/0.2.0/.release-notes.md.ftl @@ -0,0 +1,23 @@ +<#-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to you under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +# ${release.version}<#if release.date?has_content> (${release.date}) + +This release doesn't contain any functional changes. +Though the release process itself is new and noteworthy: it is performed using a shared GitHub Actions workflow stored in [`logging-parent`](https://github.com/apache/logging-parent/). + +<#include "../.changelog.md.ftl"> diff --git a/src/changelog/0.2.0/.release.xml b/src/changelog/0.2.0/.release.xml new file mode 100644 index 0000000..c3009d5 --- /dev/null +++ b/src/changelog/0.2.0/.release.xml @@ -0,0 +1,21 @@ + + + diff --git a/src/changelog/CHANGELOG.adoc.ftl b/src/changelog/CHANGELOG.adoc.ftl deleted file mode 100644 index de4a9a0..0000000 --- a/src/changelog/CHANGELOG.adoc.ftl +++ /dev/null @@ -1,84 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<#function isCommitter apacheId> - <#switch apacheId> - <#case "ckozak"> - <#case "ggregory"> - <#case "grobmeier"> - <#case "mattsicker"> - <#case "pkarwasz"> - <#case "rgoers"> - <#case "rpopma"> - <#case "vy"> - <#return true> - <#default> - <#return false> - - -<#function getGithubId apacheId> - <#switch apacheId> - <#case "ckozak"> - <#return "carterkozak"> - <#case "ggregory"> - <#return "garydgregory"> - <#case "mattsicker"> - <#return "jvz"> - <#case "pkarwasz"> - <#return "ppkarwasz"> - <#case "rpopma"> - <#return "remkop"> - <#default> - <#return apacheId> - - -<#if entriesByType?size gt 0>= ${release.version}<#if release.date?has_content> (${release.date}) -<#list entriesByType as entryType, entries> - -== ${entryType?capitalize} - -<#list entries as entry> -<@compress single_line=true> - * <#list entry.issues as issue> - ${issue.link}[${issue.id}]${issue?has_next?string(", ", ":")} - - ${entry.description.text?ensure_ends_with(".")} - <#assign first = true> - <#assign committer = ""> - <#list entry.authors as author> - <#if isCommitter(author.id!"")> - <#assign committer = author.id> - <#else> - ${first?string("Thanks to ", ", ")} - <#if author.name?has_content> - <#if author.id?has_content> - https://github.com/${author.id}[${author.name}]. - <#else> - ${author.name}. - - <#else> - https://github.com/${author.id}[${author.id}]. - - - - <#if committer?has_content> - (https://github.com/${getGithubId(committer)}[${committer}]) - - - - - -