Skip to content

Commit bd478a7

Browse files
committed
Merge branch 'refs/heads/main' into feature/log4j1-configuration-converter
# Conflicts: # log4j-converter-config/pom.xml # log4j-converter-config/src/main/java/org/apache/logging/converter/config/ConfigurationConverter.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/ComponentUtils.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/DefaultConfigurationConverter.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/XmlUtils.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/v2/AbstractJacksonConfigurationMapper.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/v2/PropertiesV2ConfigurationParser.java # log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/v2/XmlConfigurationMapper.java # log4j-converter-config/src/test/java/org/apache/logging/converter/config/ConfigurationConverterTest.java # log4j-converter-config/src/test/java/org/apache/logging/converter/config/internal/AbstractConfigurationMapperTest.java
2 parents 8ad35b9 + f4392b1 commit bd478a7

File tree

14 files changed

+297
-7
lines changed

14 files changed

+297
-7
lines changed

log4j-converter-config/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<description>Converts various logging configuration formats to the Log4j Core 2.x format.</description>
3030

3131
<properties>
32+
<!-- This artifact is an API: we need to generate its Javadoc -->
33+
<maven.javadoc.skip>false</maven.javadoc.skip>
34+
3235
<!-- Remove after first release -->
3336
<bnd.baseline.fail.on.missing>false</bnd.baseline.fail.on.missing>
3437

log4j-converter-config/src/main/java/org/apache/logging/converter/config/ConfigurationConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public interface ConfigurationConverter {
3030
* A default implementation of {@link ConfigurationConverter} that uses {@link java.util.ServiceLoader} to load additional formats.
3131
* @see org.apache.logging.converter.config.spi.ConfigurationMapper
3232
*/
33-
static ConfigurationConverter newInstance() {
34-
return new DefaultConfigurationConverter();
33+
static ConfigurationConverter getInstance() {
34+
return DefaultConfigurationConverter.INSTANCE;
3535
}
3636

3737
/**

log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/DefaultConfigurationConverter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@
4848
value = ConfigurationMapper.class,
4949
cardinality = Cardinality.MULTIPLE,
5050
resolution = Resolution.OPTIONAL)
51-
public class DefaultConfigurationConverter implements ConfigurationConverter {
51+
public final class DefaultConfigurationConverter implements ConfigurationConverter {
52+
53+
public static final ConfigurationConverter INSTANCE = new DefaultConfigurationConverter();
5254

5355
private final Map<String, ConfigurationParser> parsers = new HashMap<>();
5456
private final Map<String, ConfigurationWriter> writers = new HashMap<>();
5557

56-
public DefaultConfigurationConverter() {
58+
private DefaultConfigurationConverter() {
5759
ServiceLoader.load(ConfigurationParser.class).forEach(parser -> parsers.put(parser.getInputFormat(), parser));
5860
ServiceLoader.load(ConfigurationWriter.class).forEach(writer -> writers.put(writer.getOutputFormat(), writer));
5961
ServiceLoader.load(ConfigurationMapper.class).forEach(mapper -> {

log4j-converter-config/src/test/java/org/apache/logging/converter/config/ConfigurationConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ConfigurationConverterTest {
4040

4141
private static final String DEFAULT_FORMAT = "v2:xml";
4242

43-
private final ConfigurationConverter converter = ConfigurationConverter.newInstance();
43+
private final ConfigurationConverter converter = ConfigurationConverter.getInstance();
4444
private final ConfigurationParser parser = new XmlConfigurationMapper();
4545

4646
public static Stream<Arguments> conversionToXml() {

log4j-transform-parent/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
<assertj.version>3.26.3</assertj.version>
3636
<commons-lang.version>3.17.0</commons-lang.version>
3737
<commons-logging.version>1.3.4</commons-logging.version>
38-
<commons-io.version>2.17.0</commons-io.version>
38+
<commons-io.version>2.18.0</commons-io.version>
3939
<jmh.version>1.37</jmh.version>
4040
<junit.version>5.11.3</junit.version>
41-
<log4j.version>2.24.1</log4j.version>
41+
<log4j.version>2.24.2</log4j.version>
4242
<maven.version>3.9.9</maven.version>
4343
<picocli.version>4.7.6</picocli.version>
4444
<plexus-utils.version>4.0.2</plexus-utils.version>

pom.xml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@
108108
<!-- project version -->
109109
<revision>0.3.0-SNAPSHOT</revision>
110110

111+
<!-- disable Javadoc generation. Can be overridden in child modules -->
112+
<maven.javadoc.skip>true</maven.javadoc.skip>
113+
111114
<!-- disable `maven-site-plugin`-->
112115
<maven.site.skip>true</maven.site.skip>
113116
<maven.site.deploy.skip>true</maven.site.deploy.skip>
@@ -187,6 +190,98 @@
187190
</executions>
188191
</plugin>
189192

193+
<!-- ███████ ████████ █████ ██████ ████████ ███████ ██ ████████ ███████
194+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
195+
███████ ██ ███████ ██████ ██ ███████ ██ ██ █████
196+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
197+
███████ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ███████
198+
199+
This section consists of plugins responsible for generating the site.
200+
Note that only this (i.e., the root) module is supposed to have a `site` goal, it is skipped for all other modules! -->
201+
202+
<!-- Remove the Maven Site Plugin execution -->
203+
<plugin>
204+
<groupId>org.apache.maven.plugins</groupId>
205+
<artifactId>maven-site-plugin</artifactId>
206+
<executions>
207+
<execution>
208+
<id>default-site</id>
209+
<phase>none</phase>
210+
</execution>
211+
</executions>
212+
</plugin>
213+
<!--
214+
~ JAVADOC GENERATION
215+
~ 1. Define `currentYear` property used by the `maven-javadoc-plugin` configuration
216+
-->
217+
<plugin>
218+
<groupId>org.codehaus.mojo</groupId>
219+
<artifactId>build-helper-maven-plugin</artifactId>
220+
<executions>
221+
<execution>
222+
<id>define-currentYear-property</id>
223+
<goals>
224+
<goal>timestamp-property</goal>
225+
</goals>
226+
<phase>pre-site</phase>
227+
<inherited>false</inherited>
228+
<configuration>
229+
<name>currentYear</name>
230+
<pattern>yyyy</pattern>
231+
<locale>en_US</locale>
232+
</configuration>
233+
</execution>
234+
</executions>
235+
</plugin>
236+
<!-- 2. Generate the JavaDoc -->
237+
<plugin>
238+
<groupId>org.apache.maven.plugins</groupId>
239+
<artifactId>maven-javadoc-plugin</artifactId>
240+
<executions>
241+
<execution>
242+
<id>generate-site-javadoc</id>
243+
<goals>
244+
<goal>javadoc-no-fork</goal>
245+
</goals>
246+
<phase>pre-site</phase>
247+
<configuration combine.self="override">
248+
<!-- `notimestamp` avoids `diff` noise and is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
249+
<notimestamp>true</notimestamp>
250+
<skip>${maven.javadoc.skip}</skip>
251+
<bottom><![CDATA[<p align="center">
252+
Copyright &copy; {inceptionYear}-{currentYear} {organizationName}.
253+
All Rights Reserved.<br/>
254+
Apache, Log4j, and the Apache feather logo are trademarks or registered trademarks of {organizationName}.
255+
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
256+
Other names may be trademarks of their respective owners.
257+
</p>]]></bottom>
258+
</configuration>
259+
</execution>
260+
</executions>
261+
</plugin>
262+
<!-- 3. Move the JavaDoc to the main module -->
263+
<plugin>
264+
<groupId>org.apache.maven.plugins</groupId>
265+
<artifactId>maven-resources-plugin</artifactId>
266+
<executions>
267+
<execution>
268+
<id>copy-javadoc</id>
269+
<goals>
270+
<goal>copy-resources</goal>
271+
</goals>
272+
<phase>pre-site</phase>
273+
<configuration>
274+
<outputDirectory>${maven.multiModuleProjectDirectory}/target/site/javadoc/${project.artifactId}</outputDirectory>
275+
<resources>
276+
<resource>
277+
<directory>target/site/apidocs</directory>
278+
</resource>
279+
</resources>
280+
</configuration>
281+
</execution>
282+
</executions>
283+
</plugin>
284+
190285
</plugins>
191286
</build>
192287

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://logging.apache.org/xml/ns"
4+
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5+
type="added">
6+
<description format="asciidoc">
7+
Add `log4j-codegen` tool to generate custom loggers.
8+
</description>
9+
</entry>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://logging.apache.org/xml/ns"
4+
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5+
type="updated">
6+
<issue id="143" link="https://github.com/apache/logging-log4j-transform/pull/143"/>
7+
<description format="asciidoc">Update `commons-io:commons-io` to version `2.18.0`</description>
8+
</entry>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://logging.apache.org/xml/ns"
4+
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5+
type="updated">
6+
<issue id="144" link="https://github.com/apache/logging-log4j-transform/pull/144"/>
7+
<description format="asciidoc">Update `org.apache.logging.log4j:log4j-bom` to version `2.24.2`</description>
8+
</entry>

src/site/antora/antora.tmpl.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ asciidoc:
4444
project-id: "log4j-transform"
4545
java-target-version: "${maven.compiler.target}"
4646
java-compiler-version: "${minimalJavaBuildVersion}"
47+
examples-url: "https://github.com/apache/logging-log4j-transform/blob/main/src/site/antora/modules/ROOT/examples"
4748
logging-services-url: "https://logging.apache.org"
4849
nav:
4950
- modules/ROOT/nav.adoc

0 commit comments

Comments
 (0)