1
votes

We have a on prem installation of TFS (TFS 2017) and I am attempting to integrate SonarQube analysis into our build steps. I have installed the SonarQube extension on the TFS server and added a service endpoint to point to a server where I have SonarQube Server installed and configured.

When I attempting to trigger a build, I am getting an error "No agents could be found with the following capabilities: msbuild, java, visualstudio". Does my build server need JRE to be installed to get the SonarQube build steps to work? SonarQube website says this:

**Installation

  • Make sure the .NET Framework v4.5.2+ is installed
  • Make sure the Java Runtime Environment 8 is installed
  • Install the extension from the marketplace**
2

2 Answers

1
votes

First, the official document is very clear here: Make sure the Java Runtime Environment 8 is installed

Besides, according to your prompting error message:

No agents could be found with the following capabilities: msbuild, java, visualstudio

You are also lacking msbuild, visualstudio. Not only need Java installed, but also need Visual Studio installed on your build agent, then restart the build agent. Restarting the build agent will capture the added Capabilities. If this not work, reconfigure the build agent should do the trick.

The build agent will not detect the environment changes after you installed it. It will only detect during the installation. If you are using vNext build agent, also try to manually add some capabilities in Settings- Agent Queues- Agent Pool - Agent- Capabilities. After this trigger the build again.

Note: if you are running on TFS earlier than 2017 Update 2, you will need to download and manually install the latest 3.x version of the VSIX to install SonarQube Extension.

2
votes

Both the error message and the documentation told you the same thing: You need Java installed.

I will be the third source of confirmation: You need Java installed.