Skip to content

Commit

Permalink
Define Jenkins metadata pattern to support latest.release
Browse files Browse the repository at this point in the history
  • Loading branch information
sghill committed Apr 2, 2024
1 parent c33afef commit efe87e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/org/openrewrite/jenkins/AddPluginsBom.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
public class AddPluginsBom extends Recipe {
private static final BomLookup LOOKUP = new BomLookup();
private static final String PLUGINS_BOM_GROUP_ID = "io.jenkins.tools.bom";
private static final String LATEST_RELEASE = "latest.release";
private static final String VERSION_METADATA_PATTERN = "\\.v[a-f0-9_]+";

@Override
public String getDisplayName() {
Expand Down Expand Up @@ -99,11 +101,11 @@ public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {
return (Xml.Document) new AddManagedDependency(
PLUGINS_BOM_GROUP_ID,
bomName,
"latest.release",
LATEST_RELEASE,
"import",
"pom",
null,
null,
VERSION_METADATA_PATTERN,
true,
null,
null
Expand All @@ -129,7 +131,8 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
artifactId,
groupId,
bomName,
"latest.release"
LATEST_RELEASE,
VERSION_METADATA_PATTERN
).getVisitor());
}
}
Expand Down

0 comments on commit efe87e7

Please sign in to comment.