Skip to content
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

Bump mongodb.version from 3.12.11 to 5.0.0 #483

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#
# 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-reusable

on:
workflow_call:
inputs:
java-version:
description: The Java compiler version
default: 17
type: string
site-enabled:
description: Flag indicating if Maven `site` goal should be run
default: false
type: boolean
secrets:
CODECOV_TOKEN:
description: Codecov.io token
required: true

jobs:

build:

runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:

- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
with:
# When running on `pull_request` use the PR branch, not the target branch
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}

- name: Set up Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # 3.7.0
with:
distribution: temurin
java-version: ${{ inputs.java-version }}
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
id: build
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DtrimStackTrace=false \
-DinstallAtEnd=true \
clean install

- name: Build the website
if: inputs.site-enabled
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
site

- name: Upload test coverage
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # 4.0.2
with:
fail_ci_if_error: true
slug: ppkarwasz/logging-log4j2
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

# We upload tests results if the build fails.
- name: Upload test results
if: failure() && steps.build.conclusion == 'failure'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
with:
name: surefire-${{matrix.os}}-${{github.run_number}}-${{github.run_attempt}}
path: |
**/target/surefire-reports
**/target/logs

# `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: Verify build reproducibility
id: reproducibility
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DskipTests=true \
clean verify artifact:compare

# We reproducibility results if the build fails.
- name: Upload reproducibility results
if: failure() && steps.reproducibility.conclusion == 'failure'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
with:
name: reproducibility-${{matrix.os}}-${{github.run_number}}-${{github.run_attempt}}
path: |
**/target/bom.xml
**/target/*.buildcompare
**/target/*.jar
**/target/*.zip
**/target/reference/**
48 changes: 5 additions & 43 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,22 @@ on:
push:
branches:
- "2.x"
- "release/*"
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
pull_request:
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
- "main"
- "fix/*"
- "feature/*"

permissions: read-all

jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/10.6.0
uses: ppkarwasz/logging-log4j2/.github/workflows/build-reusable.yaml@2.x
with:
java-version: |
8
17
site-enabled: true

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@rel/10.6.0
# Secrets for deployments
secrets:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
with:
java-version: |
8
17
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

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@rel/10.6.0
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
SVN_USERNAME: ${{ secrets.LOGGING_SVN_DEV_USERNAME }}
SVN_PASSWORD: ${{ secrets.LOGGING_SVN_DEV_PASSWORD }}
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
permissions:
contents: write
with:
java-version: |
8
17
project-id: log4j
site-enabled: true
18 changes: 18 additions & 0 deletions log4j-api-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@
<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-test-coverage</id>
<phase>none</phase>
</execution>
<execution>
<id>report-aggregate-test-coverage</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
18 changes: 18 additions & 0 deletions log4j-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@
<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-test-coverage</id>
<phase>none</phase>
</execution>
<execution>
<id>report-aggregate-test-coverage</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>

<!-- Enable Log4j plugin processing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
18 changes: 18 additions & 0 deletions log4j-layout-template-json-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,24 @@
<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-test-coverage</id>
<phase>none</phase>
</execution>
<execution>
<id>report-aggregate-test-coverage</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>

<!-- Modules that contain `log4j-core` plugins, must be compiled with: `org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor` -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion log4j-mongodb3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>

<!-- Override of the parent POM version -->
<mongodb.version>3.12.11</mongodb.version>
<mongodb.version>5.0.0</mongodb.version>
</properties>

<!-- Use explicit versions as a temporary workaround to a Coursier/Ivy bug:
Expand Down
18 changes: 18 additions & 0 deletions log4j-osgi-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,24 @@
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-test-coverage</id>
<phase>none</phase>
</execution>
<execution>
<id>report-aggregate-test-coverage</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<logback.version>1.3.14</logback.version>
<maven.version>3.9.6</maven.version>
<mockito.version>4.11.0</mockito.version>
<mongodb.version>4.11.1</mongodb.version>
<mongodb.version>5.0.0</mongodb.version>
<nashorn.version>15.4</nashorn.version>
<netty.version>4.1.107.Final</netty.version>
<org.eclipse.osgi.version>3.13.0.v20180226-1711</org.eclipse.osgi.version>
Expand Down
39 changes: 39 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>

<!-- Maven plugin versions -->
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -517,6 +519,18 @@

<build>

<pluginManagement>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>

</plugins>
</pluginManagement>

<plugins>

<!-- Enable BOM flattening -->
Expand All @@ -536,6 +550,31 @@
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<includes>
<include>org/apache/log4j/**</include>
<include>org/apache/logging/log4j/**</include>
</includes>
</configuration>
<executions>
<execution>
<id>prepare-jacoco-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report-test-coverage</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Apache RAT (Release Audit Tool) check to verify licenses.
`apache-rat-plugin`: https://creadur.apache.org/rat/apache-rat-plugin/
Release Audit Tool: https://creadur.apache.org/rat/index.html -->
Expand Down
Loading