{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/39717584","id":39717584,"diff_hunk":"@@ -48,40 +50,161 @@ var publishJUnitResults = tl.getInput('publishJUnitResults');\n var testResultsFiles = tl.getInput('testResultsFiles', true);\n \n function publishTestResults(publishJUnitResults, testResultsFiles) {\n-  if(publishJUnitResults == 'true') {\n-    //check for pattern in testResultsFiles\n-    if(testResultsFiles.indexOf('*') >= 0 || testResultsFiles.indexOf('?') >= 0) {\n-      tl.debug('Pattern found in testResultsFiles parameter');\n-      var buildFolder = tl.getVariable('agent.buildDirectory');\n-      var allFiles = tl.find(buildFolder);\n-      var matchingTestResultsFiles = tl.match(allFiles, testResultsFiles, { matchBase: true });\n+    if (publishJUnitResults == 'true') {\n+        //check for pattern in testResultsFiles\n+        if (testResultsFiles.indexOf('*') >= 0 || testResultsFiles.indexOf('?') >= 0) {\n+            tl.debug('Pattern found in testResultsFiles parameter');\n+            var buildFolder = tl.getVariable('agent.buildDirectory');\n+            var allFiles = tl.find(buildFolder);\n+            var matchingTestResultsFiles = tl.match(allFiles, testResultsFiles, {\n+                matchBase: true\n+            });\n+        } else {\n+            tl.debug('No pattern found in testResultsFiles parameter');\n+            var matchingTestResultsFiles = [testResultsFiles];\n+        }\n+\n+        if (!matchingTestResultsFiles) {\n+            tl.warning('No test result files matching ' + testResultsFiles + ' were found, so publishing JUnit test results is being skipped.');\n+            return 0;\n+        }\n+\n+        var tp = new tl.TestPublisher(\"JUnit\");\n+        tp.publish(matchingTestResultsFiles, false, \"\", \"\");\n+    }\n+}\n+\n+function getSonarQubeRunner() {\n+    var sqAnalysisEnabled = tl.getInput('sqAnalysisEnabled', true);\n+\n+    if (sqAnalysisEnabled != 'true') {\n+        console.log(\"SonarQube analysis is not enabled.\");\n+        return;\n+    }\n+\n+    console.log(\"SonarQube analysis is enabled\");\n+    var sqArguments;\n+    var sqEndpoint = getEndpointDetails(\"sqConnectedServiceName\");\n+    var sqDbDetailsRequired = tl.getInput('sqDbDetailsRequired', true);\n+\n+    if (sqDbDetailsRequired == 'true') {\n+        var sqDbUrl = tl.getInput('sqDbUrl', false);\n+        var sqDbUsername = tl.getInput('sqDbUsername', false);\n+        var sqDbPassword = tl.getInput('sqDbPassword', false);","path":"Tasks/Maven/maven2.js","position":105,"original_position":105,"commit_id":"f1f9c0f508f16b6a90061ba490ebbb57def6068a","original_commit_id":"f1f9c0f508f16b6a90061ba490ebbb57def6068a","user":{"login":"bgavrilMS","id":12273384,"avatar_url":"https://avatars.githubusercontent.com/u/12273384?v=3","gravatar_id":"","url":"https://api.github.com/users/bgavrilMS","html_url":"https://github.com/bgavrilMS","followers_url":"https://api.github.com/users/bgavrilMS/followers","following_url":"https://api.github.com/users/bgavrilMS/following{/other_user}","gists_url":"https://api.github.com/users/bgavrilMS/gists{/gist_id}","starred_url":"https://api.github.com/users/bgavrilMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgavrilMS/subscriptions","organizations_url":"https://api.github.com/users/bgavrilMS/orgs","repos_url":"https://api.github.com/users/bgavrilMS/repos","events_url":"https://api.github.com/users/bgavrilMS/events{/privacy}","received_events_url":"https://api.github.com/users/bgavrilMS/received_events","type":"User","site_admin":false},"body":"Yes, the URL will no longer be required with new versions o fthe SQ server. The username and password can also be empty.","created_at":"2015-09-17T07:32:31Z","updated_at":"2015-09-17T07:32:31Z","html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/544#discussion_r39717584","pull_request_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments/39717584"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/544#discussion_r39717584"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544","id":44962880,"html_url":"https://github.com/Microsoft/vso-agent-tasks/pull/544","diff_url":"https://github.com/Microsoft/vso-agent-tasks/pull/544.diff","patch_url":"https://github.com/Microsoft/vso-agent-tasks/pull/544.patch","issue_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/544","number":544,"state":"open","locked":false,"title":"Enable SonarQube analysis for Maven, ps and js implementations","user":{"login":"bgavrilMS","id":12273384,"avatar_url":"https://avatars.githubusercontent.com/u/12273384?v=3","gravatar_id":"","url":"https://api.github.com/users/bgavrilMS","html_url":"https://github.com/bgavrilMS","followers_url":"https://api.github.com/users/bgavrilMS/followers","following_url":"https://api.github.com/users/bgavrilMS/following{/other_user}","gists_url":"https://api.github.com/users/bgavrilMS/gists{/gist_id}","starred_url":"https://api.github.com/users/bgavrilMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgavrilMS/subscriptions","organizations_url":"https://api.github.com/users/bgavrilMS/orgs","repos_url":"https://api.github.com/users/bgavrilMS/repos","events_url":"https://api.github.com/users/bgavrilMS/events{/privacy}","received_events_url":"https://api.github.com/users/bgavrilMS/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-14T18:20:29Z","updated_at":"2015-09-17T07:32:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5913c26696893621eddc64cc81ec4cc1ebe7bec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/544/comments","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/f1f9c0f508f16b6a90061ba490ebbb57def6068a","head":{"label":"Microsoft:users/bgavril/mavensonar","ref":"users/bgavril/mavensonar","sha":"f1f9c0f508f16b6a90061ba490ebbb57def6068a","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vso-agent-tasks","full_name":"Microsoft/vso-agent-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent-tasks","description":"","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","forks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/releases{/id}","created_at":"2014-12-06T11:11:46Z","updated_at":"2015-09-13T13:53:53Z","pushed_at":"2015-09-16T23:24:56Z","git_url":"git://github.com/Microsoft/vso-agent-tasks.git","ssh_url":"git@github.com:Microsoft/vso-agent-tasks.git","clone_url":"https://github.com/Microsoft/vso-agent-tasks.git","svn_url":"https://github.com/Microsoft/vso-agent-tasks","homepage":"","size":9480,"stargazers_count":108,"watchers_count":108,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":54,"forks":61,"open_issues":54,"watchers":108,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"c95860a21ed64a67f58eea4a5399726bccedff89","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vso-agent-tasks","full_name":"Microsoft/vso-agent-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent-tasks","description":"","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","forks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/releases{/id}","created_at":"2014-12-06T11:11:46Z","updated_at":"2015-09-13T13:53:53Z","pushed_at":"2015-09-16T23:24:56Z","git_url":"git://github.com/Microsoft/vso-agent-tasks.git","ssh_url":"git@github.com:Microsoft/vso-agent-tasks.git","clone_url":"https://github.com/Microsoft/vso-agent-tasks.git","svn_url":"https://github.com/Microsoft/vso-agent-tasks","homepage":"","size":9480,"stargazers_count":108,"watchers_count":108,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":54,"forks":61,"open_issues":54,"watchers":108,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544"},"html":{"href":"https://github.com/Microsoft/vso-agent-tasks/pull/544"},"issue":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/544"},"comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/544/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/pulls/544/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vso-agent-tasks/statuses/f1f9c0f508f16b6a90061ba490ebbb57def6068a"}}}}