Hi all,

I'm looking at extending the version.sh output to print the version of apr,
openssl (including when used via FFM), and tcnative that are available on
the system (so usable, but not necessarily configured for use in the
server.xml). I also think it could be useful to list the name and version
information from third party jars in lib/. Basically I want to pull all of
the library version information from the log for the libraries loaded and
have it returned here so that version.sh gives a full picture of the
environment and not just the tomcat, JDK, and OS output.

Obviously this requires extending o.a.c.util.ServerInfo, which is a bit
more involved than I thought it might be :) I would need to add the
classpath and catalina home and base to the catalina.sh script's execution
of the version block so that ServerInfo has access to those. I think I can
access all the things I want with reflection to init the classes and get
version info, and use java.util.jar.* to check the jars in lib/. Before I
dive too much into implementation I wanted to ask if anyone has thoughts
about this proposal or if there are suggestions for other useful things we
could add. If there's no objections, I'll add submitting a PR to my TODO.

Here's some example output:

```
Server version: Apache Tomcat/12.0.0-M1-dev
Server built:   Oct 22 2025 17:47:46 UTC
Server number:  12.0.0.0
OS Name:        Linux
OS Version:     6.17.4-200.fc42.x86_64
Architecture:   amd64
JVM Version:    25+36
JVM Vendor:     Red Hat, Inc.
APR loaded:     true
APR Version:    1.7.6
Tomcat Native:  1.3.0
                WARNING: Tomcat recommends a minimum version of 2.0.5
OpenSSL (APR):  OpenSSL 3.2.6 30 Sep 2025
OpenSSL (FFM):  OpenSSL 3.2.6

Third-party libraries:
  ecj-4.37.jar:                          3.43.0.v20250819-1513
  random.jar:                              (unknown)
  jakartaee-migration-1.0.9-shaded.jar:  1.0.9
```



Cheers,
Coty

Reply via email to