blob: 3e10b05aef79f2661e4e77f89c999703e0c16d04 [file] [log] [blame]
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>log4j-layout-template-json</artifactId>
<name>Apache Log4j Layout for JSON template</name>
<description>
Apache Log4j Layout for JSON template.
</description>
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
<docLabel>Log4j Layout for JSON Template Documentation</docLabel>
<projectDir>/log4j-layout-template-json</projectDir>
<module.name>org.apache.logging.log4j.layout.template.json</module.name>
<maven.doap.skip>true</maven.doap.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-layout-jackson-json</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>log4j2-ecs-layout</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.java-allocation-instrumenter</groupId>
<artifactId>java-allocation-instrumenter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Fragment-Host>org.apache.logging.log4j.layout.template.json</Fragment-Host>
<Export-Package>*</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration combine.self="override">
<archive>
<manifestFile>${manifestfile}</manifestFile>
<manifestEntries>
<Specification-Title>${project.name}</Specification-Title>
<Specification-Version>${project.version}</Specification-Version>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>default</id>
<goals>
<goal>test-jar</goal>
</goals>
<configuration>
<archive>
<manifestFile>${manifestfile}</manifestFile>
<manifestEntries>
<Specification-Title>${project.name}</Specification-Title>
<Specification-Version>${project.version}</Specification-Version>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Disabling the default execution and only using it to provide
the shared settings between individual executions. -->
<skip>true</skip>
<!-- Enforcing a non-UTF-8 encoding to check that the layout
indeed handles everything in UTF-8 without implicitly
relying on the system defaults. -->
<argLine>-Dfile.encoding=US-ASCII</argLine>
<systemPropertyVariables>
<!-- Enable JUnit 5 parallel execution. -->
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
<junit.jupiter.execution.parallel.mode.default>concurrent</junit.jupiter.execution.parallel.mode.default>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>default</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<excludes>
<exclude>**/JsonTemplateLayoutConcurrentEncodeTest.java</exclude>
<exclude>**/JsonTemplateLayoutTest.java</exclude>
</excludes>
</configuration>
</execution>
<!-- Dummy recycler execution -->
<execution>
<id>recycler-dummy</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<systemPropertyVariables>
<log4j2.layout.jsonTemplate.recyclerFactory>dummy</log4j2.layout.jsonTemplate.recyclerFactory>
</systemPropertyVariables>
<includes>
<include>**/JsonTemplateLayoutConcurrentEncodeTest.java</include>
<include>**/JsonTemplateLayoutTest.java</include>
</includes>
</configuration>
</execution>
<!-- Thread-Local recycler execution -->
<execution>
<id>recycler-tl</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<systemPropertyVariables>
<log4j2.layout.jsonTemplate.recyclerFactory>threadLocal</log4j2.layout.jsonTemplate.recyclerFactory>
</systemPropertyVariables>
<includes>
<include>**/JsonTemplateLayoutConcurrentEncodeTest.java</include>
<include>**/JsonTemplateLayoutTest.java</include>
</includes>
</configuration>
</execution>
<!-- ArrayBlockingQueue recycler execution -->
<execution>
<id>recycler-abq</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<systemPropertyVariables>
<log4j2.layout.jsonTemplate.recyclerFactory>queue:supplier=java.util.concurrent.ArrayBlockingQueue.new</log4j2.layout.jsonTemplate.recyclerFactory>
</systemPropertyVariables>
<includes>
<include>**/JsonTemplateLayoutConcurrentEncodeTest.java</include>
<include>**/JsonTemplateLayoutTest.java</include>
</includes>
</configuration>
</execution>
<!-- MpmcArrayQueue recycler execution -->
<execution>
<id>recycler-mpmc</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<systemPropertyVariables>
<log4j2.layout.jsonTemplate.recyclerFactory>queue:supplier=org.jctools.queues.MpmcArrayQueue.new</log4j2.layout.jsonTemplate.recyclerFactory>
</systemPropertyVariables>
<includes>
<include>**/JsonTemplateLayoutConcurrentEncodeTest.java</include>
<include>**/JsonTemplateLayoutTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<!-- Disable ITs, which are Docker-dependent, by default. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docker</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>all</verbose>
<startParallel>true</startParallel>
<autoCreateCustomNetworks>true</autoCreateCustomNetworks>
<images>
<image>
<alias>elasticsearch</alias>
<name>elasticsearch:${elastic.version}</name>
<run>
<env>
<discovery.type>single-node</discovery.type>
</env>
<ports>
<port>9200:9200</port>
</ports>
<network>
<mode>custom</mode>
<name>log4j-layout-template-json-network</name>
<alias>elasticsearch</alias>
</network>
<log>
<prefix>[ES]</prefix>
<color>cyan</color>
</log>
<wait>
<log>recovered \[0\] indices into cluster_state</log>
<time>60000</time>
</wait>
</run>
</image>
<image>
<alias>logstash</alias>
<name>logstash:${elastic.version}</name>
<run>
<dependsOn>
<container>elasticsearch</container>
</dependsOn>
<network>
<mode>custom</mode>
<name>log4j-layout-template-json-network</name>
<alias>logstash</alias>
</network>
<ports>
<port>12222:12222</port>
<port>12345:12345</port>
</ports>
<log>
<prefix>[LS]</prefix>
<color>green</color>
</log>
<entrypoint>
<exec>
<arg>logstash</arg>
<arg>--pipeline.batch.size</arg>
<arg>1</arg>
<arg>-e</arg>
<arg>
<![CDATA[
input {
gelf {
host => "logstash"
use_tcp => true
use_udp => false
port => 12222
type => "gelf"
}
tcp {
port => 12345
codec => json
type => "tcp"
}
}
filter {
if [type] == "gelf" {
# These are GELF/Syslog logging levels as defined in RFC 3164.
# Map the integer level to its human readable format.
translate {
field => "[level]"
destination => "[levelName]"
dictionary => {
"0" => "EMERG"
"1" => "ALERT"
"2" => "CRITICAL"
"3" => "ERROR"
"4" => "WARN"
"5" => "NOTICE"
"6" => "INFO"
"7" => "DEBUG"
}
}
}
}
output {
# (Un)comment for debugging purposes
# stdout { codec => rubydebug }
elasticsearch {
hosts => ["http://elasticsearch:9200"]
index => "log4j"
}
}
]]>
</arg>
</exec>
</entrypoint>
<wait>
<log>Successfully started Logstash API endpoint</log>
<time>60000</time>
</wait>
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>${changes.plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<issueLinkTemplate>%URL%/show_bug.cgi?id=%ISSUE%</issueLinkTemplate>
<useJql>true</useJql>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<!--<propertiesLocation>${vfs.parent.dir}/checkstyle.properties</propertiesLocation> -->
<configLocation>${log4jParentDir}/checkstyle.xml</configLocation>
<suppressionsLocation>${log4jParentDir}/checkstyle-suppressions.xml</suppressionsLocation>
<enableRulesSummary>false</enableRulesSummary>
<propertyExpansion>basedir=${basedir}</propertyExpansion>
<propertyExpansion>licensedir=${log4jParentDir}/checkstyle-header.txt</propertyExpansion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<configuration>
<bottom><![CDATA[<p align="center">Copyright &#169; {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.<br />
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>]]></bottom>
<!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating project -->
<detectOfflineLinks>false</detectOfflineLinks>
<linksource>true</linksource>
</configuration>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${jxr.plugin.version}</version>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>jxr</report>
</reports>
</reportSet>
<reportSet>
<id>aggregate</id>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${pmd.plugin.version}</version>
<configuration>
<targetJdk>${maven.compiler.target}</targetJdk>
</configuration>
</plugin>
</plugins>
</reporting>
</project>