Apache logging services logo Apache log4j logo

Building Apache log4cxx with Apache Maven 2

Apache Maven 2 is used to generate the release assemblies and generate product documentation. It delegates to CMake to build and test log4cxx and can be used as an alternate front end to the CMake build process since it can automatically download and use cmake, and log4j.

Quick start:

  • Install Apache Maven 2.0.8 or later.
  • Install APR and APR-Util.

    Building and testing log4cxx on a Unix platform with packaged APR and APR-Util.

       sudo apt-get install libapr1-dev libaprutil1-dev doxygen
       cd apache-log4cxx-x.x.x
       export PATH=/home/myself/maven-3.6.3/bin:$PATH
       mvn package

    Building and testing log4cxx on a Microsoft Windows with APR, Expat and APR-Util built from source extracted into apr-1.7.0, libexpat(from github) and apr-util-1.6.1 in %HOMEPATH%\Libraries.

       cd %HOMEPATH%\Libraries
       cmake -S libexpat\expat -B buildtrees\expat -DCMAKE_INSTALL_PREFIX=%HOMEPATH%\Libraries\installed
       cmake --build buildtrees\expat --target install --config Release
       cmake -S apr-1.7.0 -B buildtrees\apr -DCMAKE_INSTALL_PREFIX=%HOMEPATH%\Libraries\installed
       cmake --build buildtrees\apr --target install --config Release
       set CMAKE_PREFIX_PATH=%HOMEPATH%\Libraries\installed
       cmake -S apr-util-1.6.1 -B buildtrees\apr-util -DCMAKE_INSTALL_PREFIX=%HOMEPATH%\Libraries\installed
       cmake --build buildtrees\apr-util --target install --config Release
       cd apache-log4cxx-x.x.x
       set PATH=%MAVEN_HOME%\bin;%PATH%
       mvn package

Common Maven targets

compile build log4cxx library.
package build logcxx library and build and run unit tests and examples.
site Generate website and apidoc files, requires doxygen.
site assembly:assembly Generate snapshot tarball and zip file.
site-deploy Publish website to staging area on ASF subversion repository (requires credentials).
clean Delete all generated files.

All build products will be placed in the target subdirectory.

SMTP and ODBC options can depend on libraries that that have different licenses. You should review the corresponding licenses and understand the implications before redistribution.