Skip to content

Commit

Permalink
LOG4J2-2191 Made log4j-core a multi-release jar; added log4j-core-jav…
Browse files Browse the repository at this point in the history
…a9 module
  • Loading branch information
remkop committed Jan 18, 2018
1 parent 904e58b commit 46cdb7f
Show file tree
Hide file tree
Showing 8 changed files with 342 additions and 0 deletions.
153 changes: 153 additions & 0 deletions log4j-core-java9/pom.xml
@@ -0,0 +1,153 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.10.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-core-java9</artifactId>
<packaging>pom</packaging>
<name>Apache Log4j Implementation Java 9 support</name>
<description>The Apache Log4j Implementation (Java 9)</description>
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
<docLabel>Log4j Implementation Documentation</docLabel>
<projectDir>/core</projectDir>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<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>
<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>
<!-- Do not upgrade until https://issues.apache.org/jira/browse/SUREFIRE-720 is fixed -->
<version>2.13</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
<forkCount>2C</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/*FuncTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>log4j-core-java9-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/java9.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${deploy.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

51 changes: 51 additions & 0 deletions log4j-core-java9/src/assembly/java9.xml
@@ -0,0 +1,51 @@
<?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.
-->

<assembly>
<id>src</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/classes/META-INF/versions/9</outputDirectory>
<includes>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>module-info.class</exclude>
<exclude>**/Dummy.class</exclude>
<exclude>**/spi/Provider.class</exclude>
<exclude>**/util/PropertySource.class</exclude>
<exclude>**/message/ThreadDumpMessage.class</exclude>
<exclude>**/message/ThreadDumpMessage$ThreadInfoFactory.class</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/classes</outputDirectory>
<includes>
<include>module-info.class</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -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 {
}
@@ -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 {
}
@@ -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 {
}
56 changes: 56 additions & 0 deletions log4j-core/pom.xml
Expand Up @@ -38,6 +38,13 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<!-- Classes and resources to be shaded into the core jar -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core-java9</artifactId>
<scope>provided</scope>
<type>zip</type>
</dependency>
<!-- Used for OSGi bundle support -->
<dependency>
<groupId>org.osgi</groupId>
Expand Down Expand Up @@ -342,6 +349,55 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>unpack-classes</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core-java9</artifactId>
<version>${project.version}</version>
<type>zip</type>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
<includes>**/*.class</includes>
<excludes>**/*.java</excludes>
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/log4j-core-java9</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Expand Up @@ -329,6 +329,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core-java9</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
Expand Down Expand Up @@ -1296,6 +1302,7 @@
<modules>
<module>log4j-api-java9</module>
<module>log4j-api</module>
<module>log4j-core-java9</module>
<module>log4j-core</module>
<module>log4j-core-its</module>
<module>log4j-1.2-api</module>
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Expand Up @@ -31,6 +31,9 @@
- "remove" - Removed
-->
<release version="2.11.0" date="2018-xx-xx" description="GA Release 2.11.0">
<action issue="LOG4J2-2191" dev="rpopma" type="add">
Made log4j-core a multi-release ("multi-version") jar, added log4j-core-java9 module.
</action>
<action issue="LOG4J2-2129" dev="rgoers" type="fix" due-to="Blazej Bucko">
Log4j2 throws NoClassDefFoundError in Java 9 in java.util.ServiceLoader.
</action>
Expand Down

0 comments on commit 46cdb7f

Please sign in to comment.