|
5 | 5 | <groupId>io.ecocode</groupId> |
6 | 6 | <artifactId>ecocode-java-plugin</artifactId> |
7 | 7 | <version>1.6.3-SNAPSHOT</version> |
8 | | - |
| 8 | + |
9 | 9 | <packaging>sonar-plugin</packaging> |
10 | 10 |
|
11 | 11 | <name>ecoCode - Java language</name> |
|
53 | 53 | <sonar.organization>green-code-initiative</sonar.organization> |
54 | 54 | <sonar.host.url>https://sonarcloud.io</sonar.host.url> |
55 | 55 |
|
56 | | - <sonarqube.version>9.4.0.54424</sonarqube.version> |
57 | | - <sonarjava.version>7.19.0.31550</sonarjava.version> |
| 56 | + <!-- Version of SonarQube for integration tests --> |
| 57 | + <sonarqube.version>9.9.7.96285</sonarqube.version> |
| 58 | + <!-- Version of the SonarQube APIs used by `ecocode-java-plugin` --> |
| 59 | + <sonar.plugin.api.version>9.8.0.203</sonar.plugin.api.version> |
| 60 | + |
| 61 | + <!-- Version of `sonar-java-plugin` that `ecocode-java-plugin` depends on --> |
| 62 | + <sonarjava.version>7.16.0.30901</sonarjava.version> |
58 | 63 |
|
59 | 64 | <sonar-analyzer-commons.version>2.5.0.1358</sonar-analyzer-commons.version> |
60 | 65 |
|
|
66 | 71 |
|
67 | 72 | <google.re2j>1.7</google.re2j> |
68 | 73 |
|
69 | | - <!-- temporary version waiting for real automatic release in ecocode repository --> |
| 74 | + <!-- Version of ecoCode rules specifications implemented by this plugin --> |
70 | 75 | <ecocode-rules-specifications.version>1.6.5</ecocode-rules-specifications.version> |
71 | 76 |
|
| 77 | + <!-- URL of the Maven repository where sonarqube will be downloaded --> |
| 78 | + <test-it.orchestrator.artifactory.url>https://repo1.maven.org/maven2</test-it.orchestrator.artifactory.url> |
| 79 | + <!-- You can override this property to keep SonarQube instance running and to manually use it --> |
| 80 | + <test-it.sonarqube.keepRunning>false</test-it.sonarqube.keepRunning> |
| 81 | + |
| 82 | + <!-- Version of `sonarqube` used by integration tests (you can override this value to perform matrix compatibility tests) --> |
| 83 | + <test-it.sonarqube.version>${sonarqube.version}</test-it.sonarqube.version> |
| 84 | + |
| 85 | + <!-- Version of `sonar-java-plugin` used by integration tests (you can override this value to perform matrix compatibility tests) --> |
| 86 | + <test-it.sonarjava.version>${sonarjava.version}</test-it.sonarjava.version> |
| 87 | + |
| 88 | + <!-- SonarQube server listening port. Leave this property blank to automatically choose an available port. --> |
| 89 | + <test-it.sonarqube.port /> |
72 | 90 | </properties> |
73 | 91 |
|
74 | 92 | <dependencies> |
|
88 | 106 | </dependency> |
89 | 107 |
|
90 | 108 | <dependency> |
91 | | - <groupId>org.sonarsource.sonarqube</groupId> |
| 109 | + <groupId>org.sonarsource.api.plugin</groupId> |
92 | 110 | <artifactId>sonar-plugin-api</artifactId> |
93 | | - <version>${sonarqube.version}</version> |
| 111 | + <version>${sonar.plugin.api.version}</version> |
94 | 112 | <scope>provided</scope> |
95 | 113 | </dependency> |
96 | 114 |
|
|
142 | 160 | <version>0.10.2</version> |
143 | 161 | <scope>test</scope> |
144 | 162 | </dependency> |
| 163 | + |
| 164 | + <!-- Dependencies used by integration tests --> |
| 165 | + <dependency> |
| 166 | + <groupId>org.sonarsource.orchestrator</groupId> |
| 167 | + <artifactId>sonar-orchestrator-junit5</artifactId> |
| 168 | + <version>4.9.0.1920</version> |
| 169 | + <scope>test</scope> |
| 170 | + </dependency> |
| 171 | + <dependency> |
| 172 | + <groupId>org.sonarsource.java</groupId> |
| 173 | + <artifactId>test-classpath-reader</artifactId> |
| 174 | + <version>8.5.0.37199</version> |
| 175 | + <scope>test</scope> |
| 176 | + </dependency> |
| 177 | + <dependency> |
| 178 | + <groupId>org.sonarsource.sonarqube</groupId> |
| 179 | + <artifactId>sonar-ws</artifactId> |
| 180 | + <version>${sonarqube.version}</version> |
| 181 | + <scope>test</scope> |
| 182 | + </dependency> |
| 183 | + <dependency> |
| 184 | + <groupId>io.github.jycr</groupId> |
| 185 | + <artifactId>java-data-url-handler</artifactId> |
| 186 | + <version>0.0.1</version> |
| 187 | + <scope>test</scope> |
| 188 | + </dependency> |
| 189 | + <dependency> |
| 190 | + <groupId>org.slf4j</groupId> |
| 191 | + <artifactId>slf4j-api</artifactId> |
| 192 | + <version>2.0.13</version> |
| 193 | + <scope>test</scope> |
| 194 | + </dependency> |
| 195 | + <dependency> |
| 196 | + <groupId>ch.qos.logback</groupId> |
| 197 | + <artifactId>logback-classic</artifactId> |
| 198 | + <version>1.5.6</version> |
| 199 | + <scope>test</scope> |
| 200 | + </dependency> |
145 | 201 | </dependencies> |
146 | 202 |
|
147 | 203 | <build> |
|
333 | 389 | <licenseSet> |
334 | 390 | <header>com/mycila/maven/plugin/license/templates/GPL-3.txt</header> |
335 | 391 | <includes> |
336 | | - <include>**/*.java</include> |
| 392 | + <include>${project.basedir}/src/**/*.java</include> |
337 | 393 | </includes> |
| 394 | + <excludes> |
| 395 | + <exclude>${project.basedir}/src/it/test-projects/**</exclude> |
| 396 | + </excludes> |
338 | 397 | </licenseSet> |
339 | 398 | </licenseSets> |
340 | 399 | </configuration> |
|
348 | 407 | </execution> |
349 | 408 | </executions> |
350 | 409 | </plugin> |
| 410 | + <!-- activate integration tests --> |
| 411 | + <plugin> |
| 412 | + <!-- add integration test sources into test classpath --> |
| 413 | + <groupId>org.codehaus.mojo</groupId> |
| 414 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 415 | + <version>3.6.0</version> |
| 416 | + <executions> |
| 417 | + <execution> |
| 418 | + <id>add-integration-test-sources</id> |
| 419 | + <phase>process-test-sources</phase> |
| 420 | + <goals> |
| 421 | + <goal>add-test-source</goal> |
| 422 | + </goals> |
| 423 | + <configuration> |
| 424 | + <sources> |
| 425 | + <source>${project.basedir}/src/it/java</source> |
| 426 | + </sources> |
| 427 | + </configuration> |
| 428 | + </execution> |
| 429 | + <execution> |
| 430 | + <id>add-integration-test-resources</id> |
| 431 | + <phase>generate-test-resources</phase> |
| 432 | + <goals> |
| 433 | + <goal>add-test-resource</goal> |
| 434 | + </goals> |
| 435 | + <configuration> |
| 436 | + <resources> |
| 437 | + <resource> |
| 438 | + <directory>${project.basedir}/src/it/resources</directory> |
| 439 | + </resource> |
| 440 | + <resource> |
| 441 | + <filtering>true</filtering> |
| 442 | + <directory>${project.basedir}/src/it/resources-filtered</directory> |
| 443 | + </resource> |
| 444 | + </resources> |
| 445 | + </configuration> |
| 446 | + </execution> |
| 447 | + </executions> |
| 448 | + </plugin> |
| 449 | + <plugin> |
| 450 | + <!-- Execute integration tests --> |
| 451 | + <groupId>org.apache.maven.plugins</groupId> |
| 452 | + <artifactId>maven-failsafe-plugin</artifactId> |
| 453 | + <version>3.2.5</version> |
| 454 | + <executions> |
| 455 | + <execution> |
| 456 | + <goals> |
| 457 | + <goal>integration-test</goal> |
| 458 | + <goal>verify</goal> |
| 459 | + </goals> |
| 460 | + <configuration> |
| 461 | + <systemPropertyVariables> |
| 462 | + <test-it.sonarqube.keepRunning>${test-it.sonarqube.keepRunning}</test-it.sonarqube.keepRunning> |
| 463 | + <test-it.orchestrator.artifactory.url>${test-it.orchestrator.artifactory.url}</test-it.orchestrator.artifactory.url> |
| 464 | + <test-it.sonarqube.version>${test-it.sonarqube.version}</test-it.sonarqube.version> |
| 465 | + <test-it.sonarqube.port>${test-it.sonarqube.port}</test-it.sonarqube.port> |
| 466 | + <!-- Comma separated list of plugins (`groupId|artifactId|version` or `file:///`) to install in SonarQube instance before lunching integration tests --> |
| 467 | + <test-it.plugins> |
| 468 | + ${project.baseUri}/target/${project.artifactId}-${project.version}.jar, |
| 469 | + org.sonarsource.java:sonar-java-plugin:${test-it.sonarjava.version}, |
| 470 | + </test-it.plugins> |
| 471 | + <!-- Comma separated JSON profile file URIs to load --> |
| 472 | + <test-it.additional-profile-uris> |
| 473 | + ${project.baseUri}/src/main/resources/fr/greencodeinitiative/java/ecoCode_way_profile.json, |
| 474 | + </test-it.additional-profile-uris> |
| 475 | + <!-- Comma separated paths of "test projects" to analyze. Syntaxe: `sonar.projectKey|sonar.projectName|project.pomUri` --> |
| 476 | + <test-it.test-projects> |
| 477 | + io.ecocode:ecocode-java-plugin-test-project|ecoCode Java Sonar Plugin Test Project|${project.baseUri}/src/it/test-projects/ecocode-java-plugin-test-project/pom.xml, |
| 478 | + </test-it.test-projects> |
| 479 | + <!-- Comma separated list of profiles to associate to each "test project". Syntaxe: `language:profileName` --> |
| 480 | + <test-it.test-project-profile-by-language> |
| 481 | + java|ecoCode way, |
| 482 | + </test-it.test-project-profile-by-language> |
| 483 | + </systemPropertyVariables> |
| 484 | + </configuration> |
| 485 | + </execution> |
| 486 | + </executions> |
| 487 | + </plugin> |
351 | 488 | </plugins> |
352 | 489 | </build> |
| 490 | + |
| 491 | + <profiles> |
| 492 | + <profile> |
| 493 | + <id>keep-running</id> |
| 494 | + <properties> |
| 495 | + <test-it.sonarqube.keepRunning>true</test-it.sonarqube.keepRunning> |
| 496 | + <test-it.sonarqube.port>9000</test-it.sonarqube.port> |
| 497 | + </properties> |
| 498 | + </profile> |
| 499 | + </profiles> |
353 | 500 | </project> |
0 commit comments