-
Notifications
You must be signed in to change notification settings - Fork 573
Refine build scripts #18
base: main
Are you sure you want to change the base?
Conversation
The new build requires JDK8 or later, and a JDK6 installed as a maven toolchain. Main changes include: * switch to Maven 3, requiring JDK7 to invoke * switch to latest (compatible) maven plugins, requiring JDK8 to invoke * introduce two profiles: toolchain (default) and no-toolchain * toolchain profile uses maven toolchains feature with JDK6 (can also use JDK7) and source/target version of 1.4, for compatibility with JDK 1.4/5/6/7 and beyond * no-toolchain profile uses default system JDK with source/target version of 7, for compatibility with JDK 8/9/10/11/17 and beyond * stop building NTEventLogAppender.dll from maven by invoking ant (instead use the checked-in version) * replace some plugin use with resources section * replace some ant tasks with maven clean plugin * change all project metadata for correctness * remove duplicate LICENSE and NOTICE files and use the main ones * set default encoding to UTF-8 to silence some warnings * enable running all unit tests instead of a whitelist * change when and how site is generated * customize site templating for modern site plugin * remove unused and unsupported ant build files * update INSTALL document to match changes
Sets up a matrix build using github actions that runs on every push. The following combinations all work: * Toolchain 1.6, JDK 11, OS ubuntu-18.04 * Toolchain 1.6, JDK 11, OS ubuntu-20.04 * Toolchain 1.6, JDK 11, OS windows-2019 * Toolchain 1.6, JDK 11, OS windows-2022 * Toolchain 1.7, JDK 11, OS ubuntu-18.04 * JDK 8, OS ubuntu-18.04 * JDK 11, OS ubuntu-18.04 * JDK 17, OS ubuntu-18.04 * JDK 8, OS ubuntu-20.04 * JDK 11, OS ubuntu-20.04 * JDK 17, OS ubuntu-20.04 * JDK 8, OS windows-2019 * JDK 11, OS windows-2019 * JDK 17, OS windows-2019 * JDK 8, OS windows-2022 * JDK 11, OS windows-2022 * JDK 17, OS windows-2022
Now that the main build runs all tests, remove the old way of running them with ant or bash.
MDCTestCase has some nasty reflection inside that is not allowed anymore on JDK >= 17. Detect and trap the error.
Changes most tests to use unique output files during their runs, so that when they run in parallel or out-of-order or interactively they do not cause test failures, reducing flakyness of test runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly looked through the changes and they seem fine. Could use another reviewer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to comment, not approve. Still need to review pom changes for an actual approval. Other changes look good, though we could use more eyes here.
@jvz Sorry if this is stated somewhere I missed, but what's the reason for reversing the end-of-life decision for log4j 1.x? |
@larrywest , log4j 1.2 is still used a lot, and there's no drop-in replacement. |
@larrywest There has not been a decision to reverse this. There has been a request to reverse it. We just realized that when we made the subversion repo read-only that there was mirror at GitHub that people were making PRs to. That GitHub repo was not under the control of the Apache Logging project so we moved it here. Discussions have been happening on the dev list and there is currently a vote in progress between two options. The Logging Services PMC hasn't committed to doing anything as of yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commits f723b70 is a good idea
This PR should be closed. See https://github.com/apache/logging-log4j1/blob/main/README.md for rationale. See
|
This PR configures build and test scripts, so the project is buildable and testable with the current Maven and Java versions.
Note: this change does not alter the features, so I suggest merging this before other PRs that address CVEs.
Notable changes on top of Leo's commits in PR#17:
a) I simplified toolchains: the build requires Java <= 1.8 or it requires Java 1.8 (exactly) toolchain to be present.
b) I skipped "test: delete several broken low-quality tests".
In practice, what Leo calls "broken tests" are tests that need to be executed in
their own JVM (e.g. with special values for log4j.configuration, etc).
I kept the tests in ignored mode.
/cc @lsimons