Commit 46b6cf93 authored by Emmanuel Bourg's avatar Emmanuel Bourg

Update upstream source from tag 'upstream/2.9.0'

Update to upstream version '2.9.0'
with Debian dir d2d916cc0a58a50e496b4f98992b5206640ebf38
parents 1cda8170 2d92309a
......@@ -22,6 +22,8 @@ target/
.classpath
.cache-main
.cache-tests
.toDelete
.factorypath
velocity.log
felix-cache/
bin/
<?xml version="1.0" encoding="UTF8"?>
<!--
~ 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.
-->
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
<toolchain>
<type>jdk</type>
<provides>
<id>java7</id>
<version>1.7</version>
<vendor>oracle</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-7-oracle</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<id>java8</id>
<version>1.8</version>
<vendor>oracle</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-8-oracle</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<id>java9</id>
<version>9</version>
<vendor>oracle</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-9-oracle</jdkHome>
</configuration>
</toolchain>
</toolchains>
\ No newline at end of file
......@@ -11,10 +11,23 @@
# limitations under the License.
language: java
sudo: false
# sudo enabled because sudo vms have more memory: https://docs.travis-ci.com/user/ci-environment/
sudo: true
# trusty required for oraclejdk9
dist: trusty
jdk:
- oraclejdk7
env:
global:
JAVA_OPTS=-Xmx4g
install:
- ./mvnw --toolchains=./.travis-toolchains.xml install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
script:
- ./mvnw --toolchains=./.travis-toolchains.xml test -B
after_success:
- mvn --show-version -pl !log4j-bom jacoco:prepare-agent test jacoco:report coveralls:report
- ./mvnw --show-version -pl !log4j-bom jacoco:prepare-agent test jacoco:report coveralls:report
\ No newline at end of file
......@@ -16,9 +16,20 @@
-->
# Building Log4j 2
To build Log4j 2, you need a JDK implementation version 1.7 or greater, and Apache Maven.
Note that building the site requires Maven 3.0.5, while everything else works
fine with any version of Maven 3.
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.
......@@ -30,7 +41,7 @@ To perform a Clirr check on the API module, run
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`.
build with Java 8 and not deal with `MAVEN_OPTS`.
To install the jars in your local Maven repository, from a command line, run:
......@@ -50,7 +61,7 @@ If Java 7 runs out of memory building the site, you will need:
On Windows, use a local staging directory, for example:
mvn site:stage-deploy -DstagingSiteURL=file:///%HOME%/log4j
mvn site:stage-deploy -DstagingSiteURL=file:///%HOMEDRIVE%%HOMEPATH%/log4j
On UNIX, use a local staging directory, for example:
......
......@@ -13,18 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM openjdk:7-alpine
# FROM openjdk:7-alpine
# Reverted to debian yet alpine does not include jdk9
FROM openjdk:7-jdk
# Require while jdk9 is unstable on debian
RUN echo 'deb http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
RUN set -ex \
&& mkdir /src \
&& apk update \
&& apk add curl \
&& mkdir /opt \
&& apt-get update \
&& apt-get install -y \
curl \
openjdk-9-jdk-headless \
&& ln -svT "/usr/lib/jvm/java-9-openjdk-$(dpkg --print-architecture)" /docker-java-9-home \
&& cd /opt \
&& curl -fsSL http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -o maven.tar.gz \
&& curl -fsSL http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz -o maven.tar.gz \
&& tar -xzf maven.tar.gz \
&& rm -f maven.tar.gz
COPY . /src
RUN set -ex \
&& cd /src \
&& /opt/apache-maven-3.3.9/bin/mvn verify
&& /opt/apache-maven-3.5.0/bin/mvn verify --global-toolchains toolchains-docker.xml
......@@ -12,3 +12,6 @@ Copyright 2004 Jason Paul Kitchen
TypeUtil.java
Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams
picocli (http://picocli.info)
Copyright 2017 Remko Popma
......@@ -95,6 +95,8 @@ Apache Log4j 2 is distributed under the [Apache License, version 2.0](http://www
[How to download Log4j](http://logging.apache.org/log4j/2.x/download.html),
and [how to use it from Maven, Ivy and Gradle](http://logging.apache.org/log4j/2.x/maven-artifacts.html).
You can access the latest development snapshot by using the Maven repository `https://repository.apache.org/snapshots`,
see [Snapshot builds](https://logging.apache.org/log4j/2.x/maven-artifacts.html#Snapshot_builds).
## Issue Tracking
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF8"?>
<!--
~ 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.
-->
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/home/jenkins/tools/java/latest1.7</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/home/jenkins/tools/java/latest1.7</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/home/jenkins/tools/java/jdk-9-b181</jdkHome>
</configuration>
</toolchain>
<!-- other toolchains -->
</toolchains>
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.8.2</version>
<version>2.9.0</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-1.2-api</artifactId>
......@@ -33,12 +33,6 @@
<projectDir>/log4j12-api</projectDir>
</properties>
<dependencies>
<!-- Command line for configuration file conversion -->
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......
......@@ -29,21 +29,22 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.logging.log4j.core.config.ConfigurationException;
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder;
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
import org.apache.logging.log4j.core.util.BasicCommandLineArguments;
import com.beust.jcommander.Parameter;
import org.apache.logging.log4j.core.tools.BasicCommandLineArguments;
import org.apache.logging.log4j.core.tools.picocli.CommandLine;
import org.apache.logging.log4j.core.tools.picocli.CommandLine.Command;
import org.apache.logging.log4j.core.tools.picocli.CommandLine.Option;
/**
* Tool for converting a Log4j 1.x properties configuration file to Log4j 2.x XML configuration file.
*
*
* <p>
* Run with "--help" on the command line.
* </p>
*
*
* <p>
* Example:
* </p>
*
*
* <pre>
* java org.apache.log4j.config.Log4j1ConfigurationConverter --recurse
* E:\vcs\git\apache\logging\logging-log4j2\log4j-1.2-api\src\test\resources\config-1.2\hadoop --in log4j.properties --verbose
......@@ -51,21 +52,22 @@ import com.beust.jcommander.Parameter;
*/
public final class Log4j1ConfigurationConverter {
public static class CommandLineArguments extends BasicCommandLineArguments {
@Command(name = "Log4j1ConfigurationConverter")
public static class CommandLineArguments extends BasicCommandLineArguments implements Runnable {
@Parameter(names = { "--failfast", "-f" }, description = "Fails on the first failure in recurse mode.")
@Option(names = { "--failfast", "-f" }, description = "Fails on the first failure in recurse mode.")
private boolean failFast;
@Parameter(names = { "--in", "-i" }, description = "Specifies the input file.")
@Option(names = { "--in", "-i" }, description = "Specifies the input file.")
private Path pathIn;
@Parameter(names = { "--out", "-o" }, description = "Specifies the output file.")
@Option(names = { "--out", "-o" }, description = "Specifies the output file.")
private Path pathOut;
@Parameter(names = { "--recurse", "-r" }, description = "Recurses into this folder looking for the input file")
@Option(names = { "--recurse", "-r" }, description = "Recurses into this folder looking for the input file")
private Path recurseIntoPath;
@Parameter(names = { "--verbose", "-v" }, description = "Be verbose.")
@Option(names = { "--verbose", "-v" }, description = "Be verbose.")
private boolean verbose;
public Path getPathIn() {
......@@ -108,19 +110,26 @@ public final class Log4j1ConfigurationConverter {
this.verbose = verbose;
}
@Override
public void run() {
if (isHelp()) {
CommandLine.usage(this, System.err);
return;
}
new Log4j1ConfigurationConverter(this).run();
}
@Override
public String toString() {
return "CommandLineArguments [recurseIntoPath=" + recurseIntoPath + ", verbose=" + verbose + ", pathIn="
+ pathIn + ", pathOut=" + pathOut + "]";
}
}
private static final String FILE_EXT_XML = ".xml";
public static void main(final String[] args) {
new Log4j1ConfigurationConverter(BasicCommandLineArguments.parseCommandLine(args,
Log4j1ConfigurationConverter.class, new CommandLineArguments())).run();
CommandLine.run(new CommandLineArguments(), System.err, args);
}
public static Log4j1ConfigurationConverter run(final CommandLineArguments cla) {
......
......@@ -10,7 +10,6 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.8.2</version>
<version>2.9.0</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-scala_2.11</artifactId>
<packaging>jar</packaging>
<name>Apache Log4j Scala 2.11 wrapper for Log4j API</name>
<description>Scala wrapper for Log4j API</description>
<artifactId>log4j-api-java9</artifactId>
<packaging>pom</packaging>
<name>Apache Log4j API Java 9 support</name>
<description>The Apache Log4j API (Java 9)</description>
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
<projectDir>/scala_2.11</projectDir>
<scala.version>2.11.8</scala.version>
<scala.maven.plugin.version>3.2.2</scala.maven.plugin.version>
<docLabel>API Documentation</docLabel>
<projectDir>/api</projectDir>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.maven.plugin.version}</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>9</version>
</jdk>
</toolchains>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>default-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<args>
<arg>-feature</arg>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
</args>
<source>9</source>
<target>9</target>
<release>9</release>
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>