diff --git a/src/main/java/jenkinsci/plugins/influxdb/generators/SonarQubePointGenerator.java b/src/main/java/jenkinsci/plugins/influxdb/generators/SonarQubePointGenerator.java index fc6d1182..c53a5591 100644 --- a/src/main/java/jenkinsci/plugins/influxdb/generators/SonarQubePointGenerator.java +++ b/src/main/java/jenkinsci/plugins/influxdb/generators/SonarQubePointGenerator.java @@ -302,6 +302,10 @@ private String[] getSonarProjectFromBuildLog(Run build) throws IOException match = p_analysis_url.matcher(line); if (match.matches()) { url = match.group(1); + long count = url.chars().filter(ch -> ch == '/').count(); + if (count >=3) { + url = url.substring(0,url.lastIndexOf(('/'))); + } continue; } match = p_taskUrl.matcher(line);