"Fossies" - the Fresh Open Source Software Archive

Member "apache-log4j-2.12.4-src/BUILDING.md" (20 Dec 2021, 2558 Bytes) of package /linux/misc/apache-log4j-2.12.4-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the last Fossies "Diffs" side-by-side code changes report for "BUILDING.md": 2.18.0_vs_2.19.0.

Building Log4j 2

To build Log4j 2, you need a JDK implementation version 1.7 or greater, JDK version 9, and Apache Maven 3.x.

Log4j 2.x uses the Java 9 compiler in addition to the Java version installed in the path. This is accomplished by using Maven’s toolchains support. Log4j 2 provides sample toolchains XML files in the root folder. This may be used by modifying it and installing the file as toolchains.xml in the .m2 folder or by using the following when invoking Maven.

[Macintosh] -t ./toolchains-sample-mac.xml 
[Windows] -t ./toolchains-sample-win.xml 
[Linux] -t ./toolchains-sample-linux.xml 

To perform the license release audit, a.k.a. “RAT check”, run.

mvn apache-rat:check

To build the site with Java 7, make sure you give Maven enough memory using MAVEN_OPTS with options appropriate for your JVM. Alternatively, you can build with Java 8 and not deal with MAVEN_OPTS.

To install the jars in your local Maven repository, from a command line, run:

mvn clean install

Once install is run, you can run the Clirr check on the API and 1.2 API modules:

mvn clirr:check -pl log4j-api

mvn clirr:check -pl log4j-1.2-api

Next, to build the site:

If Java 7 runs out of memory building the site, you will need:

set MAVEN_OPTS=-Xmx2000m -XX:MaxPermSize=384m

mvn site

On Windows, use a local staging directory, for example:

mvn site:stage-deploy -DstagingSiteURL=file:///%HOMEDRIVE%%HOMEPATH%/log4j

On UNIX, use a local staging directory, for example:

mvn site:stage-deploy -DstagingSiteURL=file:///$HOME/log4j

To test, run:

mvn clean install

Testing in Docker

In order to run a clean test using the minimum version of the JDK along with a proper Linux environment, run:

docker build .