So it worked fine until I needed to use it in a matrix (aka multi-configuration) project. It was missing from the list of available build steps! One solution is to emulate the matrix build by having N regular builds, one for each of the configurations, to run the analyzer, but that would be very painful to maintain.
# install maven if you don't have it
brew install maven
git clone https://github.com/eunikolsky/clang-scanbuild-plugin.git --depth 1
cd clang-scanbuild-plugin/
mvn clean package
You’ll find the clang-scanbuild-plugin.hpi file in the target directory.
To install, go to Manage Jenkins > Manage Plugins > Advanced, select the clang-scanbuild-plugin.hpi file in the Upload Plugin section, and click Upload. Done.
FYI: to install scan-build on OSX without building the whole LLVM and obviously without downloading manually, is to use this command: