Skip to content

Commit 07fe8ea

Browse files
joke1196sonartech
authored andcommitted
SONARPY-4009 Added rule metadate generation to mvn profile (#1035)
GitOrigin-RevId: 5bb5e8e61cb370090d0cdb7cab35f7e7d3e413b4
1 parent e0630c6 commit 07fe8ea

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<woodstox.version>6.2.7</woodstox.version>
114114
<gson.version>2.13.2</gson.version>
115115
<jackson.version>2.21.0</jackson.version>
116+
<rule.api.version>2.19.0.5763</rule.api.version>
116117

117118
<!-- Advertise minimal required JRE version -->
118119
<jre.min.version>11</jre.min.version>

python-checks/pom.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,77 @@
7373
</dependency>
7474
</dependencies>
7575

76+
<profiles>
77+
<profile>
78+
<id>updateRule</id>
79+
<activation>
80+
<property>
81+
<name>rule.id</name>
82+
</property>
83+
</activation>
84+
<properties>
85+
<rule.branch>master</rule.branch>
86+
</properties>
87+
<build>
88+
<plugins>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-dependency-plugin</artifactId>
92+
<executions>
93+
<execution>
94+
<id>download-rule-api</id>
95+
<phase>generate-resources</phase>
96+
<goals>
97+
<goal>copy</goal>
98+
</goals>
99+
<configuration>
100+
<artifactItems>
101+
<artifactItem>
102+
<groupId>com.sonarsource.rule-api</groupId>
103+
<artifactId>rule-api</artifactId>
104+
<version>${rule.api.version}</version>
105+
<type>jar</type>
106+
<outputDirectory>${project.build.directory}</outputDirectory>
107+
<destFileName>rule-api.jar</destFileName>
108+
</artifactItem>
109+
</artifactItems>
110+
</configuration>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
<plugin>
115+
<groupId>org.codehaus.mojo</groupId>
116+
<artifactId>exec-maven-plugin</artifactId>
117+
<version>3.6.3</version>
118+
<executions>
119+
<execution>
120+
<id>run-rule-api</id>
121+
<phase>generate-resources</phase>
122+
<goals>
123+
<goal>exec</goal>
124+
</goals>
125+
<configuration>
126+
<executable>java</executable>
127+
<workingDirectory>${project.basedir}/..</workingDirectory>
128+
<arguments>
129+
<argument>-jar</argument>
130+
<argument>${project.build.directory}/rule-api.jar</argument>
131+
<argument>generate</argument>
132+
<argument>-rule</argument>
133+
<argument>${rule.id}</argument>
134+
<argument>-branch</argument>
135+
<argument>${rule.branch}</argument>
136+
</arguments>
137+
<environmentVariables>
138+
<GITHUB_TOKEN>${env.RULE_API_GH_TOKEN}</GITHUB_TOKEN>
139+
</environmentVariables>
140+
</configuration>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
</profile>
147+
</profiles>
148+
76149
</project>

0 commit comments

Comments
 (0)