Skip to content

Ports bnd-maven-plugin configuration to main #1866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
239e864
Remove references to `maven-bundle-plugin`
ppkarwasz Sep 25, 2023
e1bda51
Remove usages of `maven-jar-plugin`
ppkarwasz Sep 27, 2023
6c785db
Bump parent version to 10.1.1
ppkarwasz Sep 25, 2023
a1dcf2c
Temporarily disable Spotbugs
ppkarwasz Sep 25, 2023
0539d53
Add OSGi annotation dependencies
ppkarwasz Sep 26, 2023
defd0dc
Add multi-release to API and Core manifests
ppkarwasz Sep 27, 2023
b9aea07
Temporarily disable OSGi tests
ppkarwasz Sep 28, 2023
09fce92
Add BND configuration for `log4j-api`
ppkarwasz Sep 26, 2023
e372cf5
Add BND configuration for `log4j-core` and new modules
ppkarwasz Sep 22, 2023
536e648
Add BND configuration to `log4j-1.2-api`
ppkarwasz Sep 26, 2023
0d7e5cb
Add BND configuration to bridges
ppkarwasz Sep 29, 2023
105a855
Add BND configuration to Core dependants
ppkarwasz Sep 29, 2023
2624995
Switch to reusable builds
ppkarwasz Oct 3, 2023
10e1476
Fix filebased module names
ppkarwasz Oct 3, 2023
9c99a0f
Add `generate-email.sh`
vy Oct 4, 2023
6ce6c73
Override JPMS defaults in 1.2-api
ppkarwasz Oct 4, 2023
b3351c4
Fix OSGi tests
ppkarwasz Oct 11, 2023
9e4a1ef
Another regression in OSGi tests
ppkarwasz Oct 11, 2023
4e7b0d4
Miscelaneous problems with `bnd-maven-plugin`
ppkarwasz Oct 17, 2023
9684b30
Add OSGi package versioning and fix API breaking changes
ppkarwasz Oct 8, 2023
b13abd6
Add missing plugin versions
ppkarwasz Oct 19, 2023
a976e66
Disentangle tests writing to `AsyncLoggerConfig4Test.xml`
ppkarwasz Oct 19, 2023
196159c
Temporarily switch back to sequential tests
ppkarwasz Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#
# 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 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
#
Expand All @@ -12,6 +13,7 @@
# 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` is a branch-specific YAML configuration file for Git repositories to control features such as notifications, GitHub settings, etc.
# See its documentation for details: https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
Expand Down
106 changes: 106 additions & 0 deletions .github/generate-email.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash
#
# 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.
#

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

stderr() {
echo "$*" 1>&2
}

fail_for_invalid_args() {
stderr "Invalid arguments!"
stderr "Expected arguments: <vote|announce> <version> <commitId>"
exit 1
}

# Check arguments
[ $# -ne 3 ] && fail_for_invalid_args

# Constants
PROJECT_NAME="Apache Log4j"
PROJECT_SITE="https://logging.apache.org/log4j"
PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
PROJECT_REPO="https://github.com/apache/logging-log4j2"
PROJECT_DIST_DIR="https://dist.apache.org/repos/dist/dev/logging/log4j"
PROJECT_VERSION="$2"
COMMIT_ID="$3"

# Check release notes file
RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-sources/site/asciidoc/release-notes/$PROJECT_VERSION.adoc"
[ -f "$RELEASE_NOTES_FILE" ] || {
stderr "Couldn't find release notes file: $RELEASE_NOTES_FILE"
exit 1
}

dump_release_notes() {
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE"
}

case $1 in

vote)
cat <<EOF
To: dev@logging.apache.org
Title: [VOTE] Release $PROJECT_NAME $PROJECT_VERSION

This is a vote to release the $PROJECT_NAME $PROJECT_VERSION.

Website: $PROJECT_STAGING_SITE
GitHub: $PROJECT_REPO
Commit: $COMMIT_ID
Distribution: $PROJECT_DIST_DIR
Nexus: https://repository.apache.org/content/repositories/orgapachelogging-1113
Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0

Please download, test, and cast your votes on this mailing list.

[ ] +1, release the artifacts
[ ] -1, don't release, because...

This vote is open for 72 hours and will pass unless getting a
net negative vote count. All votes are welcome and we encourage
everyone to test the release, but only the Logging Services PMC
votes are officially counted.

=== Release Notes
EOF
dump_release_notes
;;

announce)
cat <<EOF
To: log4j-user@logging.apache.org, dev@logging.apache.org
Title: [ANNOUNCE] $PROJECT_NAME $PROJECT_VERSION released

${PROJECT_NAME} team is pleased to announce the $PROJECT_VERSION
release. ${PROJECT_NAME} is a versatile, industrial-strength
Java logging framework composed of an API, its implementation,
and components to assist the deployment for various use cases.
For further information (support, download, etc.) see the project
website[1].

[1] $PROJECT_SITE

=== Release Notes
EOF
dump_release_notes
;;

*) fail_for_invalid_args

esac
159 changes: 40 additions & 119 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,133 +20,54 @@ name: build
on:
push:
branches:
- main
- "main"
- "release/*"
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
pull_request:

env:
# Maven JVM arguments
MAVEN_OPTS: -XX:InitialRAMPercentage=50.0
# Common Maven arguments since Maven 3.9.0
MAVEN_ARGS: --show-version --batch-mode --errors --no-transfer-progress
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"

permissions: read-all

jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main
with:
java-version: 11

runs-on: ${{ matrix.os }}
# Based on: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]

steps:

- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.2.0
with:
fetch-depth: 32

- name: Setup JDK 11
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # 3.9.0
with:
distribution: temurin
java-version: 11
cache: maven

# We could have used `verify`, but `clean install` is required for the following:
# 1. The build reproducibility report
# For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
# 2. `javadoc:javadoc-no-fork`, which is attached to the `site` goal
- name: Build
timeout-minutes: 60
shell: bash
run: ./mvnw 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 \
-DskipTests=true \
clean package artifact:compare

- name: Upload reproducibility failure context artifacts
if: failure()
uses: actions/upload-artifact@v3 # 3.1.2
with:
name: reproducibility-failure-context-${{matrix.os}}
path: |
**/target/*.buildcompare
**/target/*.jar
**/target/reference/*.jar

- name: Build site
timeout-minutes: 10
shell: bash
run: ./mvnw site

merge:

runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
deploy-snapshot:
needs: build
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@main
# Secrets for deployments
secrets:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}

deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@main
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
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-log4j2' && github.ref == 'refs/heads/main'

steps:

- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.2.0
with:
fetch-depth: 32

- name: Setup JDK 11
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # 3.9.0
with:
distribution: temurin
java-version: 11
cache: maven

- name: Inspect project version
run: |
echo ::set-output name=version::$(./mvnw \
-q -Dexec.executable=echo \
-Dexec.args='${project.version}' --non-recursive exec:exec)
id: get_version

- name: Deploy artifacts
# Do not deploy release versions
if: ${{ endsWith(steps.get_version.outputs.version, '-SNAPSHOT') }}
timeout-minutes: 15
shell: bash
# `package install:install deploy:deploy` goal is needed to deploy without configuring the plugin in the POM.
# For details, see: https://maven.apache.org/plugins/maven-gpg-plugin/examples/deploy-signed-artifacts.html
run: |
./mvnw \
--settings .github/workflows/maven-settings.xml \
-Dgpg.skip=true \
-DskipTests=true \
package install:install deploy:deploy
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
with:
project-id: log4j2
distribution-attachment-filepath-pattern: |-
'^.*/target/log4j-(1\.2-api|api(-test)?|appserver|cassandra|core(-test)?|couchdb|docker|flume-ng|iostreams|jakarta-(smtp|web)|jcl|jdbc-dbcp2|jpa|jpl|jul|kubernetes|layout-template-json|mongodb[34]|log4j-slf4j2?-impl|log4j-spring-(boot|cloud-config-client)|taglib|to-(jul|slf4j)|web)'${PROJECT_VERSION}'(-sources)?\.jar$'
distribution-attachment-count: 1
site-enabled: true
60 changes: 0 additions & 60 deletions .github/workflows/log4j-kafka-test.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/maven-settings.xml

This file was deleted.

Loading