| ~~ 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. |
| ------ |
| Building Apache log4cxx with Apache Maven 2 |
| ------ |
| ------ |
| ------ |
| |
| Building Apache log4cxx with Apache Maven 2 |
| |
| {{{https://maven.apache.org}Apache Maven 2}} is used to generate the release assemblies and generate |
| product documentation. It delegates to {{{./cmake.html}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 {{{https://maven.apache.org}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. |