You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/02/29 15:34:15 UTC
(logging-log4j2) 01/04: Make docgen part of `site`
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit a93c26b3400703818b6fb1c2bb648646f23fc34a
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Wed Feb 21 20:47:52 2024 +0100
Make docgen part of `site`
---
log4j-internal-docgen/pom.xml | 218 ---------------------
log4j-parent/pom.xml | 1 -
pom.xml | 172 +++++++++++++++-
.../docgen-templates}/interface.adoc.ftl | 0
.../docgen-templates}/license.adoc.ftl | 0
.../docgen-templates}/plugin.adoc.ftl | 0
.../docgen-templates}/scalars.adoc.ftl | 0
src/site/resources/plugin-reference.html | 26 +++
src/site/site.xml | 2 +
9 files changed, 197 insertions(+), 222 deletions(-)
diff --git a/log4j-internal-docgen/pom.xml b/log4j-internal-docgen/pom.xml
deleted file mode 100644
index 75ede6fbfb..0000000000
--- a/log4j-internal-docgen/pom.xml
+++ /dev/null
@@ -1,218 +0,0 @@
-<?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>${revision}</version>
- <relativePath>../log4j-parent</relativePath>
- </parent>
-
- <artifactId>log4j-internal-docgen</artifactId>
- <packaging>pom</packaging>
-
- <name>Apache Log4j internal documentation generator</name>
- <description>Internal module for generating the plugin documentation</description>
-
- <properties>
-
- <!-- This module is only available for generating documentation during `site` phase.
- Hence, skip it for several plugins. -->
- <bnd.skip>true</bnd.skip>
- <bnd.baseline.skip>true</bnd.baseline.skip>
- <maven.deploy.skip>true</maven.deploy.skip>
- <maven.install.skip>true</maven.install.skip>
- <sign.skip>true</sign.skip>
- <spotbugs.skip>true</spotbugs.skip>
-
- <!-- Versions of libraries whose plugin descriptors will be documented: -->
- <docgen.log4j.version>2.23.0-SNAPSHOT</docgen.log4j.version>
-
- </properties>
-
- <build>
- <plugins>
-
- <!-- Download plugin descriptors -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>download-plugin-descriptors</id>
- <goals>
- <goal>copy</goal>
- </goals>
- <phase>pre-site</phase>
- <configuration>
- <outputDirectory>${project.build.directory}/plugin-descriptors</outputDirectory>
- <artifactItems>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-1.2-api</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-cassandra</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-couchdb</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-docker</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-flume-ng</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-jakarta-web</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-jdbc-dbcp2</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-jpa</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-layout-template-json</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-mongodb3</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-mongodb4</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- <artifactItem>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-spring-boot</artifactId>
- <version>${docgen.log4j.version}</version>
- <type>xml</type>
- <classifier>log4j-plugins</classifier>
- </artifactItem>
-
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-docgen-maven-plugin</artifactId>
- <version>${log4j-docgen.version}</version>
- <executions>
- <execution>
- <id>generate-plugin-docs</id>
- <goals>
- <goal>generate-documentation</goal>
- </goals>
- <phase>pre-site</phase>
- <configuration>
- <descriptorFileMatchers>
- <descriptorFileMatcher>
- <baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory>
- <pathPatterns>glob:**/*.xml</pathPatterns>
- </descriptorFileMatcher>
- </descriptorFileMatchers>
- <templateDirectory>${project.build.resources[0].directory}/templates</templateDirectory>
- <scalarsTemplate>
- <source>scalars.adoc.ftl</source>
- <target>${project.build.directory}/plugin-docs/scalars.adoc</target>
- </scalarsTemplate>
- <interfaceTemplate>
- <source>interface.adoc.ftl</source>
- <target>${project.build.directory}/plugin-docs/%g/%a/%c.adoc</target>
- </interfaceTemplate>
- <pluginTemplate>
- <source>plugin.adoc.ftl</source>
- <target>${project.build.directory}/plugin-docs/%g/%a/%c.adoc</target>
- </pluginTemplate>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
-</project>
diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml
index 4a44d7a755..18ed1234dc 100644
--- a/log4j-parent/pom.xml
+++ b/log4j-parent/pom.xml
@@ -122,7 +122,6 @@
<kubernetes-client.version>5.12.4</kubernetes-client.version>
<lightcouch.version>0.2.0</lightcouch.version>
<log4j.version>1.2.17</log4j.version>
- <log4j-docgen.version>0.8.0-SNAPSHOT</log4j-docgen.version>
<log4j2-cachefile-transformer.version>2.15.0</log4j2-cachefile-transformer.version>
<log4j2-ecs-layout.version>1.5.0</log4j2-ecs-layout.version>
<logback.version>1.3.14</logback.version>
diff --git a/pom.xml b/pom.xml
index 3aa6c45acc..2b710f6e72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -271,9 +271,6 @@
<module>log4j-to-jul</module>
<module>log4j-web</module>
- <!-- Internal modules: -->
- <module>log4j-internal-docgen</module>
-
</modules>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
@@ -336,6 +333,12 @@
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
+ <!-- Dependency versions -->
+ <log4j-docgen.version>0.8.0-SNAPSHOT</log4j-docgen.version>
+
+ <!-- Versions of libraries whose plugin descriptors will be documented: -->
+ <docgen.log4j.version>2.23.0-SNAPSHOT</docgen.log4j.version>
+
</properties>
<dependencyManagement>
@@ -739,6 +742,169 @@
</executions>
</plugin>
+ <!-- Download plugin descriptors -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>download-plugin-descriptors</id>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <phase>pre-site</phase>
+ <inherited>false</inherited>
+ <configuration>
+ <outputDirectory>${project.build.directory}/plugin-descriptors</outputDirectory>
+ <artifactItems>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-1.2-api</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-cassandra</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-couchdb</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-docker</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-flume-ng</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jakarta-web</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jdbc-dbcp2</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jpa</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-layout-template-json</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-mongodb3</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-mongodb4</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ <artifactItem>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-spring-boot</artifactId>
+ <version>${docgen.log4j.version}</version>
+ <type>xml</type>
+ <classifier>log4j-plugins</classifier>
+ </artifactItem>
+
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-docgen-maven-plugin</artifactId>
+ <version>${log4j-docgen.version}</version>
+ <executions>
+ <execution>
+ <id>generate-plugin-docs</id>
+ <goals>
+ <goal>generate-documentation</goal>
+ </goals>
+ <phase>pre-site</phase>
+ <inherited>false</inherited>
+ <configuration>
+ <descriptorFileMatchers>
+ <descriptorFileMatcher>
+ <baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory>
+ <pathPatterns>glob:**/*.xml</pathPatterns>
+ </descriptorFileMatcher>
+ </descriptorFileMatchers>
+ <templateDirectory>${project.basedir}/src/docgen-templates</templateDirectory>
+ <scalarsTemplate>
+ <source>scalars.adoc.ftl</source>
+ <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/scalars.adoc</target>
+ </scalarsTemplate>
+ <interfaceTemplate>
+ <source>interface.adoc.ftl</source>
+ <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/%g/%a/%c.adoc</target>
+ </interfaceTemplate>
+ <pluginTemplate>
+ <source>plugin.adoc.ftl</source>
+ <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/%g/%a/%c.adoc</target>
+ </pluginTemplate>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
diff --git a/log4j-internal-docgen/src/main/resources/templates/interface.adoc.ftl b/src/docgen-templates/interface.adoc.ftl
similarity index 100%
rename from log4j-internal-docgen/src/main/resources/templates/interface.adoc.ftl
rename to src/docgen-templates/interface.adoc.ftl
diff --git a/log4j-internal-docgen/src/main/resources/templates/license.adoc.ftl b/src/docgen-templates/license.adoc.ftl
similarity index 100%
rename from log4j-internal-docgen/src/main/resources/templates/license.adoc.ftl
rename to src/docgen-templates/license.adoc.ftl
diff --git a/log4j-internal-docgen/src/main/resources/templates/plugin.adoc.ftl b/src/docgen-templates/plugin.adoc.ftl
similarity index 100%
rename from log4j-internal-docgen/src/main/resources/templates/plugin.adoc.ftl
rename to src/docgen-templates/plugin.adoc.ftl
diff --git a/log4j-internal-docgen/src/main/resources/templates/scalars.adoc.ftl b/src/docgen-templates/scalars.adoc.ftl
similarity index 100%
rename from log4j-internal-docgen/src/main/resources/templates/scalars.adoc.ftl
rename to src/docgen-templates/scalars.adoc.ftl
diff --git a/src/site/resources/plugin-reference.html b/src/site/resources/plugin-reference.html
new file mode 100644
index 0000000000..12c3ecac6e
--- /dev/null
+++ b/src/site/resources/plugin-reference.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html lang="en">
+<head>
+ <title>Apache Log4j Plugin Reference</title>
+ <meta http-equiv="refresh" content="0; url=plugin-reference/org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.html"/>
+</head>
+<body>
+<p>You will be redirected to <a href="plugin-reference/org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.html">the <code>org.apache.logging.log4j.core.config.Configuration</code> reference</a>.</p>
+</body>
+</html>
diff --git a/src/site/site.xml b/src/site/site.xml
index 75c89e075e..f8882530f6 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -277,6 +277,8 @@
<item name="Developer Notes" href="/manual/plugins.html#DeveloperNotes"/>
</item>
+ <item name="Plugin reference" href="/plugin-reference.html"/>
+
<item name="Programmatic Log4j Configuration" href="/manual/customconfig.html" collapse="true">
<item name="ConfigurationBuilder API" href="/manual/customconfig.html#ConfigurationBuilder"/>
<item name="Understanding ConfigurationFactory" href="/manual/customconfig.html#ConfigurationFactory"/>