Skip to content

Commit c9933de

Browse files
SONARJAVA-5049 Add CheckListGenerator (#4818)
1 parent 28486f2 commit c9933de

18 files changed

Lines changed: 670 additions & 1467 deletions

File tree

.cirrus.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ sanity_task:
180180
sanity_script:
181181
- source cirrus-env QA
182182
- source set_maven_build_version $BUILD_NUMBER
183-
- mvn clean compile --projects java-checks-test-sources --also-make-dependents
183+
- cd java-checks-test-sources
184+
- mvn clean compile
185+
- cd ../
184186
- mvn verify -f sonar-java-plugin/pom.xml -Psanity -Dtest=SanityTest
185187
cleanup_before_cache_script: cleanup_maven_repository
186188

@@ -261,8 +263,9 @@ autoscan_task:
261263
autoscan_script:
262264
- source cirrus-env QA
263265
- source set_maven_build_version $BUILD_NUMBER
264-
- JAVA_HOME="${JAVA_21_HOME}" mvn clean compile --projects java-checks-test-sources --also-make-dependents
265-
- cd its/autoscan
266+
- cd java-checks-test-sources
267+
- JAVA_HOME="${JAVA_21_HOME}" mvn clean compile
268+
- cd ../its/autoscan
266269
- mvn clean package --batch-mode --errors --show-version --activate-profiles it-autoscan -Dsonar.runtimeVersion=LATEST_RELEASE[10.3] -Dmaven.test.redirectTestOutputToFile=false -Dparallel=methods -DuseUnlimitedThreads=true
267270
cleanup_before_cache_script: cleanup_maven_repository
268271
on_failure:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ Running this test can be broken down in 2 steps:
162162

163163
Make sure that the `java-checks-tests-sources` module has been compiled (ie: the .class files in `java-checks-tests-sources/target/` are up to date).
164164

165-
In doubt, go the top-level of the project and run:
165+
In doubt, go the [`java-checks-tests-sources`](java-checks-tests-sources) module and run:
166166
```shell
167167
# Use java 21!
168-
mvn clean compile --projects java-checks-test-sources --also-make-dependents
168+
mvn clean compile
169169
```
170170

171171
##### Executing the autoscan test

check-list/pom.xml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.sonarsource.java</groupId>
9+
<artifactId>java</artifactId>
10+
<version>8.1.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>check-list</artifactId>
14+
15+
<name>SonarQube Java :: Check List</name>
16+
<inceptionYear>2024</inceptionYear>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.sonarsource.api.plugin</groupId>
21+
<artifactId>sonar-plugin-api</artifactId>
22+
<scope>provided</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.slf4j</groupId>
26+
<artifactId>slf4j-api</artifactId>
27+
<scope>provided</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>${project.groupId}</groupId>
31+
<artifactId>java-checks</artifactId>
32+
<version>${project.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>${project.groupId}</groupId>
36+
<artifactId>java-checks-aws</artifactId>
37+
<version>${project.version}</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>com.google.code.gson</groupId>
41+
<artifactId>gson</artifactId>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.junit.jupiter</groupId>
46+
<artifactId>junit-jupiter</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.assertj</groupId>
51+
<artifactId>assertj-core</artifactId>
52+
<scope>test</scope>
53+
</dependency>
54+
</dependencies>
55+
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<groupId>org.codehaus.mojo</groupId>
60+
<artifactId>exec-maven-plugin</artifactId>
61+
<version>3.2.0</version>
62+
<executions>
63+
<execution>
64+
<phase>process-classes</phase>
65+
<goals>
66+
<goal>java</goal>
67+
</goals>
68+
<configuration>
69+
<mainClass>org.sonar.java.CheckListGenerator</mainClass>
70+
<classpathScope>compile</classpathScope>
71+
</configuration>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
<plugin>
76+
<groupId>org.codehaus.mojo</groupId>
77+
<artifactId>build-helper-maven-plugin</artifactId>
78+
<version>3.5.0</version>
79+
<executions>
80+
<execution>
81+
<phase>process-classes</phase>
82+
<goals>
83+
<goal>add-source</goal>
84+
</goals>
85+
<configuration>
86+
<sources>
87+
<source>${project.build.directory}/generated-sources</source>
88+
</sources>
89+
</configuration>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-compiler-plugin</artifactId>
96+
<executions>
97+
<execution>
98+
<phase>process-classes</phase>
99+
<goals>
100+
<!-- second compilation execution to compile the generated sources before the tests -->
101+
<goal>compile</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
<plugin>
107+
<groupId>org.apache.maven.plugins</groupId>
108+
<artifactId>maven-jar-plugin</artifactId>
109+
<executions>
110+
<execution>
111+
<phase>process-classes</phase>
112+
</execution>
113+
</executions>
114+
</plugin>
115+
</plugins>
116+
</build>
117+
</project>

0 commit comments

Comments
 (0)