pax-logging-log4j2
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-log4j2</artifactId> <version>2.3.0</version> </dependency>
<?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.ops4j.pax</groupId> <artifactId>logging</artifactId> <version>2.3.0</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-log4j2</artifactId> <packaging>bundle</packaging> <name>OPS4J Pax Logging - Log4Jv2 implementation</name> <description> Pax Logging backend implementation based on Apache Log4J2. It provides Log4J2 specific implementation of PaxLoggingService interface and Log4J2 specific configuration methods. Users may customize Log4J2 behaviour (appenders, layouts) by creating fragment attached to this bundle. </description> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <!-- We can't process annotations (as declared in log4j-core's /META-INF/services/javax.annotation.processing.Processor, which calls org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor) because we want original log4j-core's /META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat. Otherwise it'd be re-generated to include only pax-logging-log4j2's two @Plugins --> <compilerArgument>-proc:none</compilerArgument> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack-log4j-core</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <excludes>module-info.class</excludes> </artifactItem> <artifactItem> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-layout-template-json</artifactId> <excludes>**/Log4j2Plugins.dat,module-info.class</excludes> </artifactItem> </artifactItems> <outputDirectory>${project.build.directory}/classes</outputDirectory> </configuration> </execution> <execution> <id>unpack-sources</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <classifier>sources</classifier> </artifactItem> <artifactItem> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-layout-template-json</artifactId> <classifier>sources</classifier> </artifactItem> </artifactItems> <outputDirectory>${project.build.directory}/sources</outputDirectory> </configuration> </execution> <execution> <id>unpack-pax-logging-api-sources</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <dependency> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-api</artifactId> <classifier>sources</classifier> </dependency> </artifactItems> <outputDirectory>${project.build.directory}/pax-logging-api-sources</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>copy-sources</id> <phase>generate-resources</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo message="Copying sources to include in sources jar" /> <mkdir dir="${project.build.directory}/sources/org/ops4j/pax/logging/spi/support" /> <copy todir="${project.build.directory}/sources/org/ops4j/pax/logging/spi/support"> <fileset dir="${project.build.directory}/pax-logging-api-sources/org/ops4j/pax/logging/spi/support" /> </copy> <copy todir="${project.build.directory}/sources"> <fileset dir="${project.basedir}/src/main/java" /> </copy> </target> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-log4j2-maven-plugin</artifactId> <executions> <execution> <id>generate-pax-logging-log4j2-plugin-descriptor</id> <phase>prepare-package</phase> <goals> <goal>generate-log4j-plugin-descriptor</goal> </goals> <configuration> <plugins> <!-- These are equivalents of deprecated org.apache.logging.log4j.core.config.plugins.util.PluginManager.addPackage() call --> <plugin>org.ops4j.pax.logging.log4j2.internal.bridges.PaxOsgiAppender</plugin> <plugin>org.apache.logging.log4j.layout.template.json.JsonTemplateLayout</plugin> <plugin>org.apache.logging.log4j.layout.template.json.resolver.LoggerResolverFactory</plugin> <plugin>org.apache.logging.log4j.layout.template.json.util.RecyclerFactoryConverter</plugin> </plugins> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <id>enhanced-source-jar</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration> <classifier>sources</classifier> <classesDirectory>${project.build.directory}/sources</classesDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <!-- Logging --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-layout-template-json</artifactId> <scope>provided</scope> </dependency> <!-- pax-logging own artifacts --> <dependency> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-api</artifactId> </dependency> <dependency> <!-- for ordering reasons --> <groupId>org.ops4j.pax.logging</groupId> <artifactId>pax-logging-log4j2-maven-plugin</artifactId> <scope>provided</scope> </dependency> <!-- OSGi --> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi.core</artifactId> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi.cmpn</artifactId> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi.annotation</artifactId> </dependency> <!-- Other --> <dependency> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> <scope>provided</scope> </dependency> <!-- Testing --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> </dependencies> </project>