diff --git a/log4j-core-java9/pom.xml b/log4j-core-java9/pom.xml new file mode 100644 index 00000000000..e05f30ef84f --- /dev/null +++ b/log4j-core-java9/pom.xml @@ -0,0 +1,153 @@ + + + + 4.0.0 + + org.apache.logging.log4j + log4j + 2.10.1-SNAPSHOT + ../ + + log4j-core-java9 + pom + Apache Log4j Implementation Java 9 support + The Apache Log4j Implementation (Java 9) + + ${basedir}/.. + Log4j Implementation Documentation + /core + + + + junit + junit + test + + + org.apache.maven + maven-core + test + + + + + + org.apache.maven.plugins + maven-toolchains-plugin + 1.1 + + + + toolchain + + + + + + + 9 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-compile + compile + + compile + + + + default-test-compile + test-compile + + testCompile + + + + + 9 + 9 + 9 + none + + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.13 + + + test + test + + test + + + + + + true + + 2C + true + + **/Test*.java + **/*Test.java + + + **/*FuncTest.java + + + + + maven-assembly-plugin + + + zip + package + + single + + + log4j-core-java9-${project.version} + false + + src/assembly/java9.xml + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + ${deploy.plugin.version} + + true + + + + + + diff --git a/log4j-core-java9/src/assembly/java9.xml b/log4j-core-java9/src/assembly/java9.xml new file mode 100644 index 00000000000..3e595612db4 --- /dev/null +++ b/log4j-core-java9/src/assembly/java9.xml @@ -0,0 +1,51 @@ + + + + + src + + zip + + / + + + ${project.build.outputDirectory} + /classes/META-INF/versions/9 + + **/*.class + + + module-info.class + **/Dummy.class + **/spi/Provider.class + **/util/PropertySource.class + **/message/ThreadDumpMessage.class + **/message/ThreadDumpMessage$ThreadInfoFactory.class + + + + ${project.build.outputDirectory} + /classes + + module-info.class + + + + diff --git a/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Dummy.java b/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Dummy.java new file mode 100644 index 00000000000..6bffac68c33 --- /dev/null +++ b/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Dummy.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +package org.apache.logging.log4j.core.util; + +/** + * This is a dummy class and is only here to allow module-info.java to compile. It will not + * be copied into the log4j-api module. + */ +public class Dummy { +} diff --git a/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Temp.java b/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Temp.java new file mode 100644 index 00000000000..edb6d4703f3 --- /dev/null +++ b/log4j-core-java9/src/main/java/org/apache/logging/log4j/core/util/Temp.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +package org.apache.logging.log4j.core.util; + +/** + * Temporary class to ensure the log4j-core-java9 jar has at least one class (or Maven will refuse to proceed). + * To be removed as soon as real classes are added to the log4j-core-java9 module. + */ +public class Temp { +} diff --git a/log4j-core-java9/src/test/java/org/apache/logging/log4j/core/util/Dummy.java b/log4j-core-java9/src/test/java/org/apache/logging/log4j/core/util/Dummy.java new file mode 100644 index 00000000000..6bffac68c33 --- /dev/null +++ b/log4j-core-java9/src/test/java/org/apache/logging/log4j/core/util/Dummy.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +package org.apache.logging.log4j.core.util; + +/** + * This is a dummy class and is only here to allow module-info.java to compile. It will not + * be copied into the log4j-api module. + */ +public class Dummy { +} diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index 49521f5393a..97a6892f3d5 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -38,6 +38,13 @@ org.apache.logging.log4j log4j-api + + + org.apache.logging.log4j + log4j-core-java9 + provided + zip + org.osgi @@ -342,6 +349,55 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 3.0.2 + + + unpack-classes + prepare-package + + unpack + + + + + org.apache.logging.log4j + log4j-core-java9 + ${project.version} + zip + false + + + **/*.class + **/*.java + ${project.build.directory} + false + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.7 + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/log4j-core-java9 + + + + + maven-compiler-plugin diff --git a/pom.xml b/pom.xml index 7ee72a40071..5582690f030 100644 --- a/pom.xml +++ b/pom.xml @@ -329,6 +329,12 @@ test-jar test + + org.apache.logging.log4j + log4j-core-java9 + ${project.version} + zip + org.apache.logging.log4j log4j-core @@ -1296,6 +1302,7 @@ log4j-api-java9 log4j-api + log4j-core-java9 log4j-core log4j-core-its log4j-1.2-api diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 868579fcb91..8cb729a6693 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + + Made log4j-core a multi-release ("multi-version") jar, added log4j-core-java9 module. + Log4j2 throws NoClassDefFoundError in Java 9 in java.util.ServiceLoader.