In zsh, including on macOS, you should add entries to your path in your .zshrc. By default this file is read from the directory located in $ZDOTDIR which defaults to $HOME if not set.
To add an entry there, you may follow instructions for bash and add a line such as:
or because zsh also offers an interface to the path in the $path environment variable, which is an array, you may also use:
export path=(/opt/apache-maven-3.8.2/bin $path)
Either of these will add /opt/apache-maven-3.8.2/bin to your path before the previous contents of the path.
The order is important particularly for programs such as zsh which may be present at /bin/zsh and at /usr/local/bin/zsh, as would be the case if it is installed using homebrew (/bin/zsh being the default installation). If you install it separately, you probably want to use it and so should make sure that /usr/local/bin precedes /bin on your path, so to add it you should use:
in that order. And don't forget to export it after updating it with
export path or precede
If you are heavily customizing your zsh installation, you may be tempted to set the path in $ZDOTDIR/.zshenv. This should be avoided. Prior to loading that file, /etc/zprofile is read, which in a default macOS installation executes:
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
Which will screw the ordering of any customizations to your path. See the zsh man page with
man zsh for the details of the load order or
man path_helper for an explanation of that utility.