Skip to content

About

Apache Tomcat for the asdf version manager [maintainer=@mbutov]

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

asdf-tomcat Build Lint

Apache Tomcat plugin for the asdf version manager, also works with mise.

Contents

Dependencies

  • bash, curl, tar: generic POSIX utilities.
  • sha512sum, sha1sum, md5sum (Linux) or shasum, md5 (macOS) to verify downloads.
  • Java, the version depends on the Tomcat version, see Which version do I want?:
Tomcat Java
11.0 17 or later
10.1 11 or later
9.0 8 or later
8.5 7 or later

Install

Plugin:

asdf plugin add tomcat
# or
asdf plugin add tomcat https://github.com/asdf-community/asdf-tomcat.git

Tomcat:

# Show all installable versions
asdf list all tomcat

# Install the latest version, or the latest 9.0.x
asdf install tomcat latest
asdf install tomcat latest:9

# Set a version for the user (~/.tool-versions) or for the current directory
asdf set -u tomcat latest
asdf set tomcat 9.0.124

# Now catalina.sh is available
catalina.sh version
catalina.sh run

With mise:

mise plugins install tomcat https://github.com/asdf-community/asdf-tomcat.git
mise use tomcat@11

Check asdf documentation for more instructions on how to install & manage versions.

Supported versions

Stable releases of Tomcat 6 and later from the Apache archive, new major versions are picked up automatically. Milestones, betas and release candidates are not listed.

Current releases are downloaded from the Apache CDN (dlcdn.apache.org), older ones from the archive. Every download is verified with the strongest checksum Apache publishes for it (SHA-512, SHA-1 or MD5); a few very old releases have no checksum and are installed with a warning.

CATALINA_HOME

Only catalina.sh is put on PATH: the other scripts in Tomcat's bin directory have generic names (version.sh, startup.sh, digest.sh) and would clash with other tools. Use catalina.sh start and catalina.sh stop instead of startup.sh and shutdown.sh.

CATALINA_HOME is set to the selected Tomcat version every time catalina.sh runs. To get the installation directory elsewhere, e.g. for an IDE:

asdf where tomcat

Configuration

Variable Meaning
ASDF_TOMCAT_MIRROR Base URL used instead of https://dlcdn.apache.org/tomcat, the archive stays the fallback
ASDF_TOMCAT_SKIP_CHECKSUM Any non-empty value skips checksum verification, e.g. for a mirror without checksums
ASDF_TOMCAT_CACHE_TTL Seconds to keep the version list in ${XDG_CACHE_HOME:-~/.cache}/asdf-tomcat, 3600 by default, 0 disables

The version list is cached because asdf asks for it on every asdf latest, asdf list all and asdf install, and the Apache archive is slow and rate limited. A new Tomcat release shows up within an hour.

Upgrading from 1.x

  • Versions installed by 1.x keep all scripts of bin on PATH. Reinstall them to switch to catalina.sh only.
  • set-catalina-home.sh does nothing now and can be removed from the shell profile. It exported CATALINA_HOME once at shell startup, and after switching to another Tomcat version catalina.sh kept starting the old one.

Contributing

Contributions of any kind welcome! See the contributing guide.

Thanks goes to these contributors!

License

See LICENSE © Maxim Butov

About

Apache Tomcat for the asdf version manager [maintainer=@mbutov]

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages