@@ -320,6 +320,101 @@ void testUpgradeBomVersion() {
320320 .formatted (Settings .getJenkinsParentVersion (), Settings .getBomVersion ())));
321321 }
322322
323+ @ Test
324+ void testUpgradeOldBomVersionFormat () {
325+ rewriteRun (
326+ spec -> spec .recipeFromResource (
327+ "/META-INF/rewrite/recipes.yml" , "io.jenkins.tools.pluginmodernizer.UpgradeBomVersion" ),
328+ // language=xml
329+ pomXml (
330+ """
331+ <?xml version="1.0" encoding="UTF-8"?>
332+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
333+ <modelVersion>4.0.0</modelVersion>
334+ <parent>
335+ <groupId>org.jenkins-ci.plugins</groupId>
336+ <artifactId>plugin</artifactId>
337+ <version>4.0</version>
338+ <relativePath />
339+ </parent>
340+ <groupId>io.jenkins.plugins</groupId>
341+ <artifactId>empty</artifactId>
342+ <version>1.0.0-SNAPSHOT</version>
343+ <packaging>hpi</packaging>
344+ <name>Empty Plugin</name>
345+ <properties>
346+ <jenkins.version>2.164.3</jenkins.version>
347+ </properties>
348+ <dependencyManagement>
349+ <dependencies>
350+ <dependency>
351+ <groupId>io.jenkins.tools.bom</groupId>
352+ <artifactId>bom-2.164.x</artifactId>
353+ <version>3</version>
354+ <type>pom</type>
355+ <scope>import</scope>
356+ </dependency>
357+ </dependencies>
358+ </dependencyManagement>
359+ <repositories>
360+ <repository>
361+ <id>repo.jenkins-ci.org</id>
362+ <url>https://repo.jenkins-ci.org/public/</url>
363+ </repository>
364+ </repositories>
365+ <pluginRepositories>
366+ <pluginRepository>
367+ <id>repo.jenkins-ci.org</id>
368+ <url>https://repo.jenkins-ci.org/public/</url>
369+ </pluginRepository>
370+ </pluginRepositories>
371+ </project>
372+ """ ,
373+ """
374+ <?xml version="1.0" encoding="UTF-8"?>
375+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
376+ <modelVersion>4.0.0</modelVersion>
377+ <parent>
378+ <groupId>org.jenkins-ci.plugins</groupId>
379+ <artifactId>plugin</artifactId>
380+ <version>4.0</version>
381+ <relativePath />
382+ </parent>
383+ <groupId>io.jenkins.plugins</groupId>
384+ <artifactId>empty</artifactId>
385+ <version>1.0.0-SNAPSHOT</version>
386+ <packaging>hpi</packaging>
387+ <name>Empty Plugin</name>
388+ <properties>
389+ <jenkins.version>2.164.3</jenkins.version>
390+ </properties>
391+ <dependencyManagement>
392+ <dependencies>
393+ <dependency>
394+ <groupId>io.jenkins.tools.bom</groupId>
395+ <artifactId>bom-2.164.x</artifactId>
396+ <version>10</version>
397+ <type>pom</type>
398+ <scope>import</scope>
399+ </dependency>
400+ </dependencies>
401+ </dependencyManagement>
402+ <repositories>
403+ <repository>
404+ <id>repo.jenkins-ci.org</id>
405+ <url>https://repo.jenkins-ci.org/public/</url>
406+ </repository>
407+ </repositories>
408+ <pluginRepositories>
409+ <pluginRepository>
410+ <id>repo.jenkins-ci.org</id>
411+ <url>https://repo.jenkins-ci.org/public/</url>
412+ </pluginRepository>
413+ </pluginRepositories>
414+ </project>
415+ """ ));
416+ }
417+
323418 @ Test
324419 void testRemoveDependenciesOverride () {
325420 rewriteRun (
0 commit comments