Skip to content

Commit ef6bd8e

Browse files
guillaume-dequennesonartech
authored andcommitted
SONARPY-4156 Add Maven profile to update rules metadata via rule-api (#1102)
GitOrigin-RevId: d0a98be1c258fad3ca32713c8c59b78a5684f7d1
1 parent 00a008f commit ef6bd8e

2 files changed

Lines changed: 68 additions & 1 deletion

File tree

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@
323323
<reuseForks>true</reuseForks>
324324
</configuration>
325325
</plugin>
326+
<plugin>
327+
<groupId>org.codehaus.mojo</groupId>
328+
<artifactId>exec-maven-plugin</artifactId>
329+
<version>3.6.3</version>
330+
</plugin>
326331
</plugins>
327332
</pluginManagement>
328333
</build>

python-checks/pom.xml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
<plugin>
115115
<groupId>org.codehaus.mojo</groupId>
116116
<artifactId>exec-maven-plugin</artifactId>
117-
<version>3.6.3</version>
118117
<executions>
119118
<execution>
120119
<id>run-rule-api</id>
@@ -144,6 +143,69 @@
144143
</plugins>
145144
</build>
146145
</profile>
146+
<profile>
147+
<id>updateAllRules</id>
148+
<activation>
149+
<property>
150+
<name>update.rules</name>
151+
<value>true</value>
152+
</property>
153+
</activation>
154+
<build>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-dependency-plugin</artifactId>
159+
<executions>
160+
<execution>
161+
<id>download-rule-api-all</id>
162+
<phase>generate-resources</phase>
163+
<goals>
164+
<goal>copy</goal>
165+
</goals>
166+
<configuration>
167+
<artifactItems>
168+
<artifactItem>
169+
<groupId>com.sonarsource.rule-api</groupId>
170+
<artifactId>rule-api</artifactId>
171+
<version>${rule.api.version}</version>
172+
<type>jar</type>
173+
<outputDirectory>${project.build.directory}</outputDirectory>
174+
<destFileName>rule-api.jar</destFileName>
175+
</artifactItem>
176+
</artifactItems>
177+
</configuration>
178+
</execution>
179+
</executions>
180+
</plugin>
181+
<plugin>
182+
<groupId>org.codehaus.mojo</groupId>
183+
<artifactId>exec-maven-plugin</artifactId>
184+
<executions>
185+
<execution>
186+
<id>run-rule-api-all</id>
187+
<phase>generate-resources</phase>
188+
<goals>
189+
<goal>exec</goal>
190+
</goals>
191+
<configuration>
192+
<executable>java</executable>
193+
<workingDirectory>${project.basedir}/..</workingDirectory>
194+
<arguments>
195+
<argument>-jar</argument>
196+
<argument>${project.build.directory}/rule-api.jar</argument>
197+
<argument>update</argument>
198+
</arguments>
199+
<environmentVariables>
200+
<GITHUB_TOKEN>${env.RULE_API_GH_TOKEN}</GITHUB_TOKEN>
201+
</environmentVariables>
202+
</configuration>
203+
</execution>
204+
</executions>
205+
</plugin>
206+
</plugins>
207+
</build>
208+
</profile>
147209
</profiles>
148210

149211
</project>

0 commit comments

Comments
 (0)