Skip to content

Commit 079f699

Browse files
committed
Merge remote-tracking branch 'apache/main' into feature/main/split-jul
2 parents ef72bf1 + e455376 commit 079f699

File tree

14 files changed

+100
-16
lines changed

14 files changed

+100
-16
lines changed

log4j-async-logger/src/test/java/org/apache/logging/log4j/async/logger/AsyncLoggerConfigTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public void testSingleFilterInvocation() {
111111
disruptor.start();
112112
try {
113113
config.log(FQCN, FQCN, null, Level.INFO, new SimpleMessage(), null);
114-
verify(appender, timeout(100).times(1)).append(any());
114+
// If this fails, the log event might not have reached the asynchronous thread yet
115+
verify(appender, timeout(1000).times(1)).append(any());
115116
verify(filter, times(1)).filter(any());
116117
} finally {
117118
disruptor.stop();

log4j-core/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
java.xml;transitive=false,
6767
jdk.unsupported;transitive=false,
6868
org.fusesource.jansi;transitive=false,
69+
org.jspecify;transitive=false
6970
</bnd-extra-module-options>
7071

7172
<log4j.docgen.pluginDescriptorsDir>${log4j.docgen.pluginDescriptorsDir.phase1}</log4j.docgen.pluginDescriptorsDir>

log4j-jul/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<description>The Apache Log4j implementation of java.util.logging</description>
3030

3131
<properties>
32+
<!--
33+
~ OSGi and JPMS options
34+
-->
3235
<bnd-extra-package-options>
3336
<!-- Optional annotations -->
3437
org.jspecify.*;resolution:=optional

log4j-kit/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
<!-- JSpecify is optional at runtime -->
3636
org.jspecify.annotations.*;resolution:=optional
3737
</bnd-extra-package-options>
38-
<bnd-extra-module-options>org.jspecify;transitive:=false</bnd-extra-module-options>
38+
<bnd-extra-module-options>
39+
<!-- Optional dependencies should not be `static` -->
40+
org.jspecify;transitive=false
41+
</bnd-extra-module-options>
3942
</properties>
4043

4144
<dependencies>

log4j-parent/pom.xml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<asciidoctor-maven-plugin.version>2.2.4</asciidoctor-maven-plugin.version>
8888
<docker-maven-plugin.version>0.43.4</docker-maven-plugin.version>
8989
<exam-maven-plugin.version>4.13.5</exam-maven-plugin.version>
90+
<gmavenplus-plugin.version>3.0.2</gmavenplus-plugin.version>
9091
<!-- `surefire.version` property used in `apache.org:apache`: -->
9192
<surefire.version>3.5.0</surefire.version>
9293

@@ -104,7 +105,7 @@
104105
<commons-lang3.version>3.17.0</commons-lang3.version>
105106
<commons-logging.version>1.3.4</commons-logging.version>
106107
<disruptor.version>4.0.0</disruptor.version>
107-
<elasticsearch.version>7.17.23</elasticsearch.version>
108+
<elasticsearch.version>7.17.24</elasticsearch.version>
108109
<embedded-ldap.version>0.9.0</embedded-ldap.version>
109110
<felix.version>7.0.5</felix.version>
110111
<flapdoodle-embed.version>4.13.1</flapdoodle-embed.version>
@@ -139,7 +140,7 @@
139140
<mongodb.version>5.1.3</mongodb.version>
140141
<nashorn.version>15.4</nashorn.version>
141142
<opentest4j.version>1.3.0</opentest4j.version>
142-
<org.eclipse.osgi.version>3.20.0</org.eclipse.osgi.version>
143+
<org.eclipse.osgi.version>3.21.0</org.eclipse.osgi.version>
143144
<oro.version>2.0.8</oro.version>
144145
<!-- The OSGi API version MUST always be the MINIMUM version Log4j supports -->
145146
<osgi.framework.version>1.10.0</osgi.framework.version>
@@ -148,7 +149,7 @@
148149
<plexus-utils.version>3.5.1</plexus-utils.version>
149150
<slf4j2.version>2.0.15</slf4j2.version>
150151
<system-stubs.version>2.1.6</system-stubs.version>
151-
<tomcat-juli.version>10.1.28</tomcat-juli.version>
152+
<tomcat-juli.version>10.1.29</tomcat-juli.version>
152153
<velocity.version>1.7</velocity.version>
153154
<wiremock.version>2.35.2</wiremock.version>
154155
<xmlunit.version>2.10.0</xmlunit.version>
@@ -838,6 +839,68 @@
838839
</executions>
839840
</plugin>
840841

842+
<plugin>
843+
<groupId>org.codehaus.gmavenplus</groupId>
844+
<artifactId>gmavenplus-plugin</artifactId>
845+
<version>${gmavenplus-plugin.version}</version>
846+
<dependencies>
847+
<dependency>
848+
<groupId>org.apache.groovy</groupId>
849+
<artifactId>groovy-ant</artifactId>
850+
<version>${groovy.version}</version>
851+
<scope>runtime</scope>
852+
</dependency>
853+
<dependency>
854+
<groupId>org.apache.groovy</groupId>
855+
<artifactId>groovy</artifactId>
856+
<version>${groovy.version}</version>
857+
<scope>runtime</scope>
858+
</dependency>
859+
</dependencies>
860+
<executions>
861+
<execution>
862+
<id>ban-static-transitive</id>
863+
<goals>
864+
<goal>execute</goal>
865+
</goals>
866+
<phase>verify</phase>
867+
<configuration>
868+
<continueExecuting>false</continueExecuting>
869+
<scripts>
870+
<script><![CDATA[
871+
import java.io.StringWriter
872+
import java.util.spi.ToolProvider
873+
874+
if ("jar" != project.packaging) {
875+
log.info("Skipping module descriptor check, since the project type is not `jar`.")
876+
return
877+
}
878+
String jarFile = project.build.directory + "/" + project.build.finalName + ".jar";
879+
if (!new File(jarFile).exists()) {
880+
log.info("Skipping module descriptor check, since `" + jarFile + "` is missing.")
881+
return
882+
}
883+
StringWriter out = new StringWriter()
884+
StringWriter err = new StringWriter()
885+
ToolProvider jar = ToolProvider.findFirst("jar").orElseThrow()
886+
int result = jar.run(new PrintWriter(out), new PrintWriter(err), "-d", "-f", jarFile)
887+
if (result != 0) {
888+
throw new RuntimeException("Failed to decompile the module descriptor in `" + jarFile + "`:\n" + err)
889+
}
890+
log.debug("Module descriptor: " + out)
891+
for (String line : out.toString().split("\r?\n", -1)) {
892+
if (line.contains("static") && line.contains("transitive")) {
893+
throw new RuntimeException("The `static` and `transitive` modifiers should not be use together: " + line)
894+
}
895+
}
896+
log.info("Successfully verified module descriptor in `" + jarFile + "`.")
897+
]]></script>
898+
</scripts>
899+
</configuration>
900+
</execution>
901+
</executions>
902+
</plugin>
903+
841904
</plugins>
842905
</build>
843906

log4j-plugins/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
com.google.errorprone.annotations.concurrent;resolution:=optional,
3838
org.jspecify.annotations.*;resolution:=optional
3939
</bnd-extra-package-options>
40+
<bnd-extra-module-options>
41+
<!-- Optional dependencies should not be `static` -->
42+
org.jspecify;transitive=false
43+
</bnd-extra-module-options>
4044
</properties>
4145

4246
<dependencies>

log4j-to-jul/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<!-- Annotations only -->
3535
org.jspecify.*;resolution:=optional
3636
</bnd-extra-package-options>
37+
<bnd-extra-module-options>
38+
<!-- Remove `transitive` for optional dependencies -->
39+
org.jspecify;transitive=false
40+
</bnd-extra-module-options>
3741
</properties>
3842

3943
<dependencies>

log4j-to-slf4j/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
<!-- This bridge also support SLF4J 2.x -->
4646
org.slf4j.*;version="${slf4j.support.range}"
4747
</bnd-extra-package-options>
48+
<bnd-extra-module-options>
49+
<!-- Remove `transitive` for optional dependencies -->
50+
org.jspecify;transitive=false
51+
</bnd-extra-module-options>
4852
</properties>
4953
<dependencies>
5054
<dependency>

src/changelog/.3.x.x/update_org_apache_tomcat_tomcat_juli.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
xmlns="https://logging.apache.org/xml/ns"
44
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
55
type="updated">
6-
<issue id="2802" link="https://github.com/apache/logging-log4j2/pull/2802"/>
7-
<description format="asciidoc">Update `org.apache.tomcat:tomcat-juli` to version `10.1.28`</description>
6+
<issue id="2944" link="https://github.com/apache/logging-log4j2/pull/2944"/>
7+
<description format="asciidoc">Update `org.apache.tomcat:tomcat-juli` to version `10.1.29`</description>
88
</entry>

src/changelog/.3.x.x/update_org_eclipse_platform_org_eclipse_osgi.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
xmlns="https://logging.apache.org/xml/ns"
44
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
55
type="updated">
6-
<issue id="2650" link="https://github.com/apache/logging-log4j2/pull/2650"/>
7-
<description format="asciidoc">Update `org.eclipse.platform:org.eclipse.osgi` to version `3.20.0`</description>
6+
<issue id="2938" link="https://github.com/apache/logging-log4j2/pull/2938"/>
7+
<description format="asciidoc">Update `org.eclipse.platform:org.eclipse.osgi` to version `3.21.0`</description>
88
</entry>

0 commit comments

Comments
 (0)