Skip to content

Commit 1354dfa

Browse files
committed
Move code generation to log4j-codegen artifact
The code generation code is moved from `log4j-core` to a new `log4j-codegen` module. Additionally: * The embedded PicoCLI copy is replaced with an external PicoCLI dependency. * `log4j-codegen` publishes a shaded artifact with the classifier `shaded`. * We add a documentation page with basic usage.
1 parent 030f5d6 commit 1354dfa

File tree

14 files changed

+458
-5911
lines changed

14 files changed

+458
-5911
lines changed

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
target/
16+
# IntelliJ IDEA
1717
.idea
1818
*.iml
1919
*.iws
20-
/out
21-
.flattened-pom.xml
22-
/.mvn/wrapper/maven-wrapper.jar
2320
# Eclipse
2421
.project
2522
.classpath
2623
.settings/
24+
# Generated by Maven
25+
.flattened-pom.xml
26+
dependency-reduced-pom.xml
27+
/.mvn/wrapper/maven-wrapper.jar
28+
target/
2729
# Node
2830
node
2931
node_modules

log4j-codegen/pom.xml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to you under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
<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">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>org.apache.logging.log4j</groupId>
22+
<artifactId>log4j-transform-parent</artifactId>
23+
<version>${revision}</version>
24+
<relativePath>../log4j-transform-parent</relativePath>
25+
</parent>
26+
27+
<artifactId>log4j-codegen</artifactId>
28+
<name>Apache Log4j Code generator</name>
29+
<description>Generates wrappers for Log4j code loggers.</description>
30+
31+
<properties>
32+
<!-- Disabling `bnd-baseline-maven-plugin`, since we don't have a release yet to compare against. -->
33+
<bnd.baseline.fail.on.missing>false</bnd.baseline.fail.on.missing>
34+
35+
<Main-Class>org.apache.logging.log4j.codegen.Generate</Main-Class>
36+
37+
<!-- Plugin versions -->
38+
<maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
39+
40+
<!-- Dependencies -->
41+
<picocli.version>4.7.5</picocli.version>
42+
</properties>
43+
44+
<dependencies>
45+
46+
<dependency>
47+
<groupId>org.osgi</groupId>
48+
<artifactId>org.osgi.annotation.bundle</artifactId>
49+
<scope>provided</scope>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>org.osgi</groupId>
54+
<artifactId>org.osgi.annotation.versioning</artifactId>
55+
<scope>provided</scope>
56+
</dependency>
57+
58+
<dependency>
59+
<groupId>com.github.spotbugs</groupId>
60+
<artifactId>spotbugs-annotations</artifactId>
61+
<scope>provided</scope>
62+
</dependency>
63+
64+
<!-- Compile dependencies: the artifact is shaded, so limit these to the maximum -->
65+
<dependency>
66+
<groupId>info.picocli</groupId>
67+
<artifactId>picocli</artifactId>
68+
<version>${picocli.version}</version>
69+
</dependency>
70+
71+
<!-- Test dependencies -->
72+
<dependency>
73+
<groupId>org.apache.logging.log4j</groupId>
74+
<artifactId>log4j-api</artifactId>
75+
<scope>test</scope>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>org.apache.logging.log4j</groupId>
80+
<artifactId>log4j-api-test</artifactId>
81+
<scope>test</scope>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>org.junit.jupiter</groupId>
86+
<artifactId>junit-jupiter-api</artifactId>
87+
<scope>test</scope>
88+
</dependency>
89+
90+
</dependencies>
91+
92+
<build>
93+
94+
<plugins>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-compiler-plugin</artifactId>
98+
<configuration>
99+
<annotationProcessorPaths combine.children="append">
100+
<path>
101+
<groupId>info.picocli</groupId>
102+
<artifactId>picocli-codegen</artifactId>
103+
<version>${picocli.version}</version>
104+
</path>
105+
</annotationProcessorPaths>
106+
</configuration>
107+
</plugin>
108+
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-shade-plugin</artifactId>
112+
<version>${maven-shade-plugin.version}</version>
113+
<dependencies>
114+
<dependency>
115+
<groupId>org.apache.logging.log4j</groupId>
116+
<artifactId>log4j-transform-maven-shade-plugin-extensions</artifactId>
117+
<version>${project.version}</version>
118+
</dependency>
119+
</dependencies>
120+
<executions>
121+
<execution>
122+
<id>shade-jar-with-dependencies</id>
123+
<goals>
124+
<goal>shade</goal>
125+
</goals>
126+
<configuration>
127+
<filters>
128+
<filter>
129+
<artifact>*:*</artifact>
130+
<excludes>
131+
<exclude>module-info.class</exclude>
132+
<exclude>META-INF/versions/*/module-info.class</exclude>
133+
<exclude>META-INF/MANIFEST.MF</exclude>
134+
</excludes>
135+
</filter>
136+
</filters>
137+
<shadedArtifactAttached>true</shadedArtifactAttached>
138+
<shadedClassifierName>shaded</shadedClassifierName>
139+
<transformers>
140+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
141+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer" />
142+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
143+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
144+
<manifestEntries>
145+
<Multi-Release>true</Multi-Release>
146+
</manifestEntries>
147+
</transformer>
148+
</transformers>
149+
</configuration>
150+
</execution>
151+
</executions>
152+
</plugin>
153+
</plugins>
154+
155+
</build>
156+
157+
</project>

0 commit comments

Comments
 (0)