if(userCredentials == null) {
sonar=Sonar.create(serverUrl);
}else{
sonar=Sonar.create(serverUrl, userCredentials.getUsername(), PassEncoder.decodeAsString(userCredentials.getPassword()));
}
ServerQuery serverQuery=new ServerQuery();
return sonar.find(serverQuery).getVersion();
}