Skip to content

Commit

Permalink
Merge NormalizeMavenVariables into PrefixlessExpressions (#3600)
Browse files Browse the repository at this point in the history
Due to overlap, and the latter replacing more instances.
  • Loading branch information
timtebeek authored Oct 3, 2023
1 parent b0eddd0 commit 5675dd6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 137 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ public String getDescription() {

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
return Preconditions.check(new MavenVisitor<ExecutionContext>() {
@Override
public Xml visitDocument(Xml.Document document, ExecutionContext executionContext) {
// Scanning every tag's value is not an efficient applicable test, so just accept all maven files
return SearchResult.found(document);
}
}, new MavenIsoVisitor<ExecutionContext>() {
return new MavenIsoVisitor<ExecutionContext>() {
final String oldKeyAsProperty = "${" + oldKey + "}";
final String newKeyAsProperty = "${" + newKey + "}";

Expand All @@ -76,6 +70,6 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
}
return t;
}
});
};
}
}
12 changes: 12 additions & 0 deletions rewrite-maven/src/main/resources/META-INF/rewrite/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ name: org.openrewrite.maven.cleanup.PrefixlessExpressions
displayName: Drop prefixless expressions in POM
description: MNG-7404 drops support for prefixless in POMs. This recipe will add the `project.` prefix where missing.
recipeList:
- org.openrewrite.maven.RenamePropertyKey:
oldKey: basedir
newKey: project.basedir
- org.openrewrite.maven.RenamePropertyKey:
oldKey: build.timestamp
newKey: project.build.timestamp
- org.openrewrite.maven.RenamePropertyKey:
oldKey: groupId
newKey: project.groupId
- org.openrewrite.maven.RenamePropertyKey:
oldKey: artifactId
newKey: project.artifactId
- org.openrewrite.maven.RenamePropertyKey:
oldKey: version
newKey: project.version
Expand Down

This file was deleted.

0 comments on commit 5675dd6

Please sign in to comment.