Created
May 18, 2018 09:00
-
-
Save kwon37xi/a293a4bbc86f1286ce0b150863861009 to your computer and use it in GitHub Desktop.
groovy httpbuilder-ng를 이용한 sonarqube api호출
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grapes([ | |
@Grab(group='io.github.http-builder-ng', module='http-builder-ng-apache', version='1.0.3') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.25') | |
]) | |
import static groovyx.net.http.HttpBuilder.configure | |
def sonarqubeHttp = configure { | |
request.uri = 'http://sonarqube.example.com' | |
} | |
def response = sonarqubeHttp.get() { | |
request.uri.path = '/api/measures/component' | |
request.uri.query = [component: 'project:module', metricKeys: 'ncloc,complexity,violations,blocker_violations,critical_violations,major_violations,minor_violations,info_violations'] | |
} | |
println response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment