Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Refine build scripts #18

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
max_line_length = 120

[*.java]
# Doc: https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0
#"all other", "java.", "javax.", "all static"
ij_java_imports_layout = *,|,java.**,|,javax.**,|,$*
ij_java_use_single_class_imports = true
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Auto detect text files and perform LF normalization
* text=auto

*.java text
*.html text
*.css text
*.js text
*.sql text
*.q text

*.bat text eol=crlf
*.cmd text eol=crlf

# Blow files don't have extension, so we mention them explicitly
/src/changes/changes.xml merge=union

45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners

jobs:
Test:
name: JDK ${{ matrix.jdk }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
jdk: [8, 11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: true
max-parallel: 4
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
- name: Set up Java 8
id: setup-java-8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Set up Java ${{ matrix.jdk }}
if: ${{ matrix.jdk != '8' }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Compile
# download dependencies, etc, so test log looks better
run: mvn -B --toolchains .github/workflows/toolchains.xml compile
env:
JAVA_HOME_8: ${{ steps.setup-java-8.outputs.path }}
- name: Test
run: mvn -B --toolchains .github/workflows/toolchains.xml verify
env:
JAVA_HOME_8: ${{ steps.setup-java-8.outputs.path }}
12 changes: 12 additions & 0 deletions .github/workflows/toolchains.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>${env.JAVA_HOME_8}</jdkHome>
</configuration>
</toolchain>
</toolchains>
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target/
/tests/output/
/tests/temp/
/.idea/
84 changes: 39 additions & 45 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
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.


===========
Using log4j
===========

1) First untar or unzip the distribution file.

2) Assuming you chose to extract the distribution in to the
Expand All @@ -27,17 +11,17 @@ Using log4j
directory PATH_OF_YOUR_CHOICE/apache-log4j-VERSION/ as $LOG4J_HOME/.

3) Add $LOG4J_HOME/log4j-VERSION.jar to your CLASSPATH,

4) You can now test your installation by first compiling the following
simple program.

import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;

public class Hello {

private static final Logger logger = Logger.getLogger(Hello.class);

public
static
void main(String argv[]) {
Expand All @@ -51,7 +35,7 @@ Using log4j
After compilation, try it out by issuing the command

java Hello

You should see log statements appearing on the console.

5) Refer to the javadoc documentation and the user manual on how to
Expand All @@ -73,32 +57,42 @@ except test cases and classes from the "examples" and
Building log4j
==============

log4j (as of 1.2.15) is built with Maven 2. To rebuild log4j,
place Maven 2 on the PATH and execute "mvn package". The resulting
jar will be placed in the target subdirectory.
log4j (as of 1.2.18) is built with Maven 3 and JDK 8 or higher.

The project compiles to Java 1.4 bytecode, so you need to have Java 8 for that.
If you run Maven with newer Java version, you need to configure
the location of Java 1.8 via ~/.m2/toolchains.xml.

<?xml version="1.0" encoding="UTF-8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>/path/to/java-1.8.0_222</jdkHome>
<!-- <jdkHome>C:\Program Files\Java\jdk1.8.0_222</jdkHome> -->
</configuration>
</toolchain>
</toolchains>

See https://maven.apache.org/guides/mini/guide-using-toolchains.html
for more information about maven toolchains.

After setting up a toolchain you can then build using the following command:

If building with JDK 1.4, one dependency will need to be manually
installed since its license does not allow it to be placed in the
online maven repositories. If not already installed, a build attempt will
describe where to download and how to install the dependency. To
install the dependency:
mvn verify

Download JMX 1.2.1 from http://java.sun.com/products/JavaManagement/download.html.
Build results can be found in the target/ subdirectory.

$ jar xf jmx-1_2_1-ri.zip
$ mvn install:install-file -DgroupId=com.sun.jmx -DartifactId=jmxri \
-Dversion=1.2.1 -Dpackaging=jar -Dfile=jmx-1_2_1-bin/lib/jmxri.jar
==================
NTEventLogAppender
==================

The maven build uses prebuilt NTEventLogAppender.dll and
NTEventLogAppender.amd64.dll binaries. To rebuild these, see

The build script will attempt to build NTEventLogAppender.dll if
MinGW is available on the path. If the unit tests are run on Windows
without NTEventLogAppender.dll, many warnings of the missing DLL
will be generated. An installer for MinGW on Windows is
available for download at http://sourceforge.net/project/showfiles.php?group_id=2435.
MinGW is also available through the package managers of many Linux distributions.
src/ntdll

In case of problems send an e-mail note to
[email protected]. Please do not directly e-mail any
log4j developers. The answer to your question might be useful to other
users. Moreover, there are many knowledgeable users on the log4j-user
mailing lists who can quickly answer your questions.
for more information.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache log4j
Copyright 2010 The Apache Software Foundation
Copyright 2000-2021 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Binary file added NTEventLogAppender.dll
Binary file not shown.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# About

log4j a logging library for Java.

# Status

log4j 1.x is feature complete, so do not expect new features to appear,
however, security issues might be fixed.

See [the log4j 1.2 website](https://logging.apache.org/log4j/1.2/) for more information.

# Log4shell

log4j 1.x is not vulnerable to CVE-2021-45105, CVE-2021-45046, and CVE-2021-44228.
71 changes: 0 additions & 71 deletions build.properties.sample

This file was deleted.

Loading