|
44 | 44 |
|
45 | 45 | <docker.networks>vlapi</docker.networks> |
46 | 46 | <docker.data.base.name>mongodb</docker.data.base.name> |
| 47 | + |
| 48 | + <project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory> |
| 49 | + <jacoco.utReportFolder>${project.build.directory}/jacoco/test</jacoco.utReportFolder> |
| 50 | + <jacoco.utReportFile>${jacoco.utReportFolder}/test.exec</jacoco.utReportFile> |
| 51 | + <junit.utReportFolder>${project.testresult.directory}/test</junit.utReportFolder> |
47 | 52 | </properties> |
48 | 53 |
|
49 | 54 | <dependencies> |
|
187 | 192 | <target>${maven.compiler.target}</target> |
188 | 193 | </configuration> |
189 | 194 | </plugin> |
190 | | - <plugin> |
191 | | - <groupId>org.springframework.boot</groupId> |
192 | | - <artifactId>spring-boot-maven-plugin</artifactId> |
193 | | - <executions> |
194 | | - <execution> |
195 | | - <id>pre-integration-test</id> |
196 | | - <goals> |
197 | | - <goal>start</goal> |
198 | | - </goals> |
199 | | - </execution> |
200 | | - <execution> |
201 | | - <id>post-integration-test</id> |
202 | | - <goals> |
203 | | - <goal>stop</goal> |
204 | | - </goals> |
205 | | - </execution> |
206 | | - </executions> |
207 | | - </plugin> |
208 | 195 | <plugin> |
209 | 196 | <groupId>org.apache.maven.plugins</groupId> |
210 | 197 | <artifactId>maven-surefire-plugin</artifactId> |
211 | 198 | <configuration> |
| 199 | + <!-- Force alphabetical order to have a reproducible build --> |
| 200 | + <runOrder>alphabetical</runOrder> |
| 201 | + <reportsDirectory>${junit.utReportFolder}</reportsDirectory> |
212 | 202 | <skipTests>${skip-tests}</skipTests> |
213 | 203 | <workingDirectory>${project.build.directory}</workingDirectory> |
214 | 204 | <trimStackTrace>false</trimStackTrace> |
|
229 | 219 | <version>0.8.5</version> |
230 | 220 | <executions> |
231 | 221 | <execution> |
232 | | - <id>prepare-agent</id> |
| 222 | + <id>pre-unit-tests</id> |
233 | 223 | <goals> |
234 | 224 | <goal>prepare-agent</goal> |
235 | 225 | </goals> |
| 226 | + <configuration> |
| 227 | + <!-- Sets the path to the file which contains the execution data. --> |
| 228 | + <destFile>${jacoco.utReportFile}</destFile> |
| 229 | + </configuration> |
236 | 230 | </execution> |
237 | 231 | <execution> |
238 | 232 | <id>post-unit-test</id> |
239 | 233 | <phase>test</phase> |
240 | 234 | <goals> |
241 | 235 | <goal>report</goal> |
242 | | - <goal>check</goal> |
243 | 236 | </goals> |
244 | 237 | <configuration> |
| 238 | + <dataFile>${jacoco.utReportFile}</dataFile> |
| 239 | + <outputDirectory>${jacoco.utReportFolder}</outputDirectory> |
245 | 240 | <excludes> |
246 | 241 | <exclude>**/*VirtualLibraryApiApplication.*</exclude> |
247 | 242 | <exclude>br/com/virtuallibrary/commons/**/*</exclude> |
|
267 | 262 | </execution> |
268 | 263 | </executions> |
269 | 264 | </plugin> |
| 265 | + <plugin> |
| 266 | + <groupId>org.apache.maven.plugins</groupId> |
| 267 | + <artifactId>maven-failsafe-plugin</artifactId> |
| 268 | + <configuration> |
| 269 | + <!-- Due to spring-boot repackage, without adding this property test |
| 270 | + classes are not found See https://github.com/spring-projects/spring-boot/issues/6254 --> |
| 271 | + <classesDirectory>${project.build.outputDirectory}</classesDirectory> |
| 272 | + <!-- Force alphabetical order to have a reproducible build --> |
| 273 | + <runOrder>alphabetical</runOrder> |
| 274 | + <reportsDirectory>${junit.itReportFolder}</reportsDirectory> |
| 275 | + <includes> |
| 276 | + <include>**/*IT*</include> |
| 277 | + <include>**/*IntTest*</include> |
| 278 | + </includes> |
| 279 | + </configuration> |
| 280 | + <executions> |
| 281 | + <execution> |
| 282 | + <id>integration-test</id> |
| 283 | + <goals> |
| 284 | + <goal>integration-test</goal> |
| 285 | + </goals> |
| 286 | + </execution> |
| 287 | + <execution> |
| 288 | + <id>verify</id> |
| 289 | + <goals> |
| 290 | + <goal>verify</goal> |
| 291 | + </goals> |
| 292 | + </execution> |
| 293 | + </executions> |
| 294 | + </plugin> |
270 | 295 | <plugin> |
271 | 296 | <groupId>org.apache.maven.plugins</groupId> |
272 | 297 | <artifactId>maven-resources-plugin</artifactId> |
|
319 | 344 | <outputDir>${project.build.directory}</outputDir> |
320 | 345 | </configuration> |
321 | 346 | </plugin> |
| 347 | + <plugin> |
| 348 | + <groupId>org.sonarsource.scanner.maven</groupId> |
| 349 | + <artifactId>sonar-maven-plugin</artifactId> |
| 350 | + <version>3.7.0.1746</version> |
| 351 | + </plugin> |
| 352 | + <plugin> |
| 353 | + <groupId>org.codehaus.mojo</groupId> |
| 354 | + <artifactId>properties-maven-plugin</artifactId> |
| 355 | + <version>1.0.0</version> |
| 356 | + <executions> |
| 357 | + <execution> |
| 358 | + <phase>initialize</phase> |
| 359 | + <goals> |
| 360 | + <goal>read-project-properties</goal> |
| 361 | + </goals> |
| 362 | + <configuration> |
| 363 | + <files> |
| 364 | + <file>sonar-project.properties</file> |
| 365 | + </files> |
| 366 | + </configuration> |
| 367 | + </execution> |
| 368 | + </executions> |
| 369 | + </plugin> |
322 | 370 | </plugins> |
323 | 371 | </build> |
324 | 372 |
|
|
0 commit comments