@@ -4,6 +4,7 @@ def repo = 'seleniumkit/gridrouter'
4
4
def buildWarJob = mavenJob(" ${ project} _build-war" )
5
5
def e2eTestsJob = job(" ${ project} _e2e-tests" )
6
6
def sonarJob = mavenJob(" ${ project} _sonar" )
7
+ def sonarIncrJob = mavenJob(" ${ project} _sonar-incr" )
7
8
def deployJob = mavenJob(" ${ project} _deploy" )
8
9
9
10
def pullRequestJob = multiJob(" ${ project} _pull-reqest_flow" )
@@ -76,7 +77,34 @@ sonarJob.with {
76
77
}
77
78
78
79
publishers {
79
- sonar ()
80
+ sonar()
81
+ }
82
+ }
83
+
84
+ sonarIncrJob. with {
85
+
86
+ label(' maven' )
87
+ scm {
88
+ git {
89
+ remote {
90
+ github(repo, ' https' , ' github.com' )
91
+ refspec(' ${GIT_REFSPEC}' )
92
+ }
93
+ branch(' ${GIT_COMMIT}' )
94
+ localBranch(' master' )
95
+ }
96
+ }
97
+
98
+ configure {
99
+ it / 'publishers' / ' hudson.plugins.sonar.SonarPublisher' {
100
+ jdk(' (Inherit From Job)' )
101
+ branch()
102
+ language()
103
+ jobAdditionalProperties(' -Dsonar.analysis.mode=incremental -Dsonar.github.pullRequest=${ghprbPullId} -Dsonar.github.repository=' + repo)
104
+ settings(class : ' jenkins.mvn.DefaultSettingsProvider' )
105
+ globalSettings(class : ' jenkins.mvn.DefaultGlobalSettingsProvider' )
106
+ usePrivateRepository(false )
107
+ }
80
108
}
81
109
}
82
110
@@ -124,6 +152,10 @@ pullRequestJob.with {
124
152
125
153
steps {
126
154
phase(' Build war file' ) {
155
+ job(sonarIncrJob. name) {
156
+ prop(' GIT_REFSPEC' , ' +refs/pull/*:refs/remotes/origin/pr/*' );
157
+ prop(' GIT_COMMIT' , ' \$ {sha1}' );
158
+ }
127
159
job(buildWarJob. name) {
128
160
prop(' GIT_REFSPEC' , ' +refs/pull/*:refs/remotes/origin/pr/*' );
129
161
prop(' GIT_COMMIT' , ' \$ {sha1}' );
@@ -207,7 +239,7 @@ releaseJob.with {
207
239
}
208
240
}
209
241
210
- goals (' clean deploy' )
242
+ goals(' clean deploy' )
211
243
212
244
wrappers {
213
245
mavenRelease {
0 commit comments