Skip to content

Commit 02c9b0f

Browse files
authored
Enabling CI for azure-openrewrite (Azure#43988)
* [WIP] Enabling CI * Updates to enable CI * Adjusting pom for CI * Adjusting pom for CI * Updates to PR * Updates to enable CI * Updates to enable CI * Updates to enable CI * Updates to enable CI * Updates to enable CI
1 parent 31dbe2b commit 02c9b0f

27 files changed

+296
-1162
lines changed

sdk/tools/azure-openrewrite/pom.xml

Lines changed: 204 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<name>Microsoft Azure OpenRewrite Plugin library for Java</name>
1212
<description>This module contains OpenRewrite recipe for migrating to next generation Microsoft Azure client libraries.</description>
1313

14+
<properties>
15+
<packageOutputDirectory>${project.build.directory}</packageOutputDirectory>
16+
</properties>
17+
1418
<dependencyManagement>
1519
<dependencies>
1620
<dependency>
@@ -31,14 +35,31 @@
3135
<scope>compile</scope>
3236
</dependency>
3337

34-
<!-- You only need the version that corresponds to your current
35-
Java version. It is fine to add all of them, though, as
36-
they can coexist on a classpath. -->
37-
<dependency>
38-
<groupId>org.openrewrite</groupId>
39-
<artifactId>rewrite-java-8</artifactId>
40-
<scope>test</scope>
41-
</dependency>
38+
<!-- To test on different JDKs multiple within CI,
39+
we need to include multiple rewrite-java test dependencies -->
40+
<dependency>
41+
<groupId>org.openrewrite</groupId>
42+
<artifactId>rewrite-java-8</artifactId>
43+
<scope>test</scope>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.openrewrite</groupId>
48+
<artifactId>rewrite-java-11</artifactId>
49+
<scope>test</scope>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>org.openrewrite</groupId>
54+
<artifactId>rewrite-java-17</artifactId>
55+
<scope>test</scope>
56+
</dependency>
57+
58+
<dependency>
59+
<groupId>org.openrewrite</groupId>
60+
<artifactId>rewrite-java-21</artifactId>
61+
<scope>test</scope>
62+
</dependency>
4263

4364
<!-- rewrite-maven dependency only necessary for Maven Recipe development -->
4465
<dependency>
@@ -126,6 +147,181 @@
126147
<artifactId>maven-pmd-plugin</artifactId>
127148
<version>3.15.0</version>
128149
</plugin>
150+
<!-- generate sources jar -->
151+
<plugin>
152+
<groupId>org.apache.maven.plugins</groupId>
153+
<artifactId>maven-source-plugin</artifactId>
154+
<version>3.3.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-source-plugin;external_dependency} -->
155+
<executions>
156+
<execution>
157+
<id>attach-sources</id>
158+
<goals>
159+
<goal>jar</goal>
160+
</goals>
161+
<configuration>
162+
<outputDirectory>${packageOutputDirectory}</outputDirectory>
163+
</configuration>
164+
</execution>
165+
</executions>
166+
</plugin>
167+
168+
<!-- Copy the pom file to output -->
169+
<plugin>
170+
<groupId>org.apache.maven.plugins</groupId>
171+
<artifactId>maven-antrun-plugin</artifactId>
172+
<version>3.1.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-antrun-plugin;external_dependency} -->
173+
<executions>
174+
<execution>
175+
<id>copy</id>
176+
<phase>package</phase>
177+
<configuration>
178+
<target>
179+
<copy file="${project.pomFile}" tofile="${packageOutputDirectory}/${project.build.finalName}.pom"/>
180+
</target>
181+
</configuration>
182+
<goals>
183+
<goal>run</goal>
184+
</goals>
185+
</execution>
186+
</executions>
187+
</plugin>
188+
189+
<!-- generate javadoc jar -->
190+
<plugin>
191+
<groupId>org.apache.maven.plugins</groupId>
192+
<artifactId>maven-javadoc-plugin</artifactId>
193+
<version>3.10.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
194+
<executions>
195+
<execution>
196+
<id>attach-javadocs</id>
197+
<goals>
198+
<goal>jar</goal>
199+
</goals>
200+
</execution>
201+
</executions>
202+
</plugin>
203+
204+
<!-- This plugin scans checkstyle issues in the code -->
205+
<plugin>
206+
<groupId>org.apache.maven.plugins</groupId>
207+
<artifactId>maven-checkstyle-plugin</artifactId>
208+
<version>3.5.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-checkstyle-plugin;external_dependency} -->
209+
<dependencies>
210+
<dependency>
211+
<groupId>com.azure</groupId>
212+
<artifactId>sdk-build-tools</artifactId>
213+
<version>1.0.0</version> <!-- {x-version-update;com.azure:sdk-build-tools;external_dependency} -->
214+
</dependency>
215+
<dependency>
216+
<groupId>com.puppycrawl.tools</groupId>
217+
<artifactId>checkstyle</artifactId>
218+
<version>9.3</version> <!-- {x-version-update;com.puppycrawl.tools:checkstyle;external_dependency} -->
219+
</dependency>
220+
</dependencies>
221+
<configuration>
222+
<configLocation>${project.basedir}/../../../eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml</configLocation>
223+
<suppressionsLocation>${project.basedir}/../../../eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
224+
<headerLocation>${project.basedir}/../../../eng/code-quality-reports/src/main/resources/checkstyle/java.header</headerLocation>
225+
<propertyExpansion>samedir=</propertyExpansion>
226+
<encoding>UTF-8</encoding>
227+
<consoleOutput>true</consoleOutput>
228+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
229+
<linkXRef>true</linkXRef>
230+
<failsOnError>true</failsOnError>
231+
<failOnViolation>true</failOnViolation>
232+
</configuration>
233+
</plugin>
234+
<!-- This plugin scans reports spotbugs in the code -->
235+
<plugin>
236+
<groupId>com.github.spotbugs</groupId>
237+
<artifactId>spotbugs-maven-plugin</artifactId>
238+
<version>4.8.3.1</version> <!-- {x-version-update;com.github.spotbugs:spotbugs-maven-plugin;external_dependency} -->
239+
<dependencies>
240+
<dependency>
241+
<groupId>com.azure</groupId>
242+
<artifactId>sdk-build-tools</artifactId>
243+
<version>1.0.0</version> <!-- {x-version-update;com.azure:sdk-build-tools;external_dependency} -->
244+
</dependency>
245+
<dependency>
246+
<groupId>com.github.spotbugs</groupId>
247+
<artifactId>spotbugs</artifactId>
248+
<version>4.8.3</version> <!-- {x-version-update;com.github.spotbugs:spotbugs;external_dependency} -->
249+
</dependency>
250+
<!-- Needed as the version of Spotbugs being used isn't compatible is Java 18+ without this. -->
251+
<dependency>
252+
<groupId>org.ow2.asm</groupId>
253+
<artifactId>asm</artifactId>
254+
<version>9.7</version> <!-- {x-version-update;org.ow2.asm:asm;external_dependency} -->
255+
</dependency>
256+
</dependencies>
257+
<configuration>
258+
<effort>max</effort>
259+
<threshold>Low</threshold>
260+
<xmlOutput>true</xmlOutput>
261+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
262+
<excludeFilterFile>${project.basedir}/../../../eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml</excludeFilterFile>
263+
<fork>true</fork>
264+
</configuration>
265+
</plugin>
266+
267+
<!-- Checks public surface area for breaking changes. -->
268+
<plugin>
269+
<groupId>org.revapi</groupId>
270+
<artifactId>revapi-maven-plugin</artifactId>
271+
<version>0.14.6</version> <!-- {x-version-update;org.revapi:revapi-maven-plugin;external_dependency} -->
272+
<configuration>
273+
<skip>true</skip>
274+
</configuration>
275+
<dependencies>
276+
<dependency>
277+
<groupId>com.azure</groupId>
278+
<artifactId>sdk-build-tools</artifactId>
279+
<version>1.0.0</version> <!-- {x-version-update;com.azure:sdk-build-tools;external_dependency} -->
280+
</dependency>
281+
<dependency>
282+
<groupId>org.revapi</groupId>
283+
<artifactId>revapi-java</artifactId>
284+
<version>0.26.1</version> <!-- {x-version-update;org.revapi:revapi-java;external_dependency} -->
285+
</dependency>
286+
<dependency>
287+
<groupId>org.revapi</groupId>
288+
<artifactId>revapi-reporter-json</artifactId>
289+
<version>0.4.5</version> <!-- {x-version-update;org.revapi:revapi-reporter-json;external_dependency} -->
290+
</dependency>
291+
</dependencies>
292+
</plugin>
293+
294+
<plugin>
295+
<groupId>com.azure.tools</groupId>
296+
<artifactId>codesnippet-maven-plugin</artifactId>
297+
<version>1.0.0-beta.10</version> <!-- {x-version-update;com.azure.tools:codesnippet-maven-plugin;external_dependency} -->
298+
<configuration>
299+
<readmeGlob>**/*.md</readmeGlob>
300+
</configuration>
301+
<executions>
302+
<execution>
303+
<id>update-codesnippets</id>
304+
<goals>
305+
<goal>update-codesnippet</goal>
306+
</goals>
307+
</execution>
308+
<execution>
309+
<id>verify-codesnippets</id>
310+
<goals>
311+
<goal>verify-codesnippet</goal>
312+
</goals>
313+
</execution>
314+
</executions>
315+
</plugin>
316+
317+
<plugin>
318+
<groupId>com.diffplug.spotless</groupId>
319+
<artifactId>spotless-maven-plugin</artifactId>
320+
<version>2.30.0</version> <!-- {x-version-update;com.diffplug.spotless:spotless-maven-plugin;external_dependency} -->
321+
<configuration>
322+
<skip>true</skip>
323+
</configuration>
324+
</plugin>
129325
</plugins>
130326
</build>
131327
</project>

0 commit comments

Comments
 (0)