Manually installing Detect ensures that the running version is compatible with your environment. Invoking Detect with the bash and powershell scripts is easy but automatically downloaded updates may not be compatible with your environment.
The best practice for resilience is to add Detect on the path, allowing for an easier invocation than even the bash and powershell scripts. It still allows easy updating without modifying commands just as the bash and powershell scripts do. This is the recommended best practice approach when resiliency is required.
Basic Manual Installation Steps
Download Java and make sure it is on your PATH
Download the version of Detect you want to use from https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/detect/
You should download the air gap zip if you do not want Detect to download Inspectors at runtime
Put the Detect jar/zip somewhere you can manage it
Examples:
Mac/Linux: $HOME/detect/download/detect-X.X.X.jar
Windows: C:\Program Files\detect\download\detect-X.X.X.jar
You can now run Detect
Example: java -jar $HOME/detect/download/detect-X.X.X.jar --help
Mac/Linux Best Practice Installation Steps for Resilience
Download Java and make sure it is on your PATH
Download the version of Detect you want to use from https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/detect/
You should download the air gap zip if you do not want Detect to download Inspectors at runtime
Create a symlink for the Detect jar
ln -s $HOME/detect/download/detect-X.X.X.jar $HOME/detect/download/latest-detect.jar
Create a bash script named "detect" with the following content.
#!/bin/bashjava -jar $HOME/detect/download/latest-detect.jar "$@"
Add the script to your PATH variable
export PATH=${PATH}:${path_to_folder_containing_detect_script}
OR instead of altering your PATH you can place the script in a directory that is already on your PATH
Example: /usr/local/bin
You can now run Detect
Example: detect --help
Windows Best Practice Installation Steps for Resilience
Download Java and make sure it is on your PATH
Download the version of Detect you want to use from https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/detect/
You should download the air gap zip if you do not want Detect to download Inspectors at runtime
Create a symbolic link for the Detect jar, called latest-detect.jar
Start a command prompt in the folder you downloaded detect.
Run the following: mklink latest-detect.jar detect-X.X.X.jar
Create a bat script named "detect.cmd" in the same folder with the following content
@java -jar "C:\Program Files\detect\download\latest-detect.jar" %*
Add the script to your PATH variable
In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environment Variables
Under System Variables select Path, then click Edit
Add an entry with the path to the folder containing the script "C:\Program Files\detect\download"
You can now run Detect
Example: detect --help