CustomRecipe to update dependency based on property type found in application.yaml(add dependency visitor not working) #4972
Replies: 1 comment 1 reply
-
You would need to implement this as a During the SCAN phase, you would use a YAML visitor to detect your property or potentially reuse the FindProperty recipe to help detect the property that you are search for and record it's presence and any other data in the accumulator object. Then during the EDIT phase, you would utilize the The reason that your current structure doesn't work is that the |
Beta Was this translation helpful? Give feedback.
-
doAfterVisit been invoked but its not updating the pom.xml with dependency. Please assist. Not sure what is being missed here.
@value
@EqualsAndHashCode(callSuper = false)
@slf4j
public class AddDependencyIfPropertyExists extends Recipe {
private final String propertyPath;
private final String groupId;
private final String artifactId;
private final String version;
@JsonCreator
public AddDependencyIfPropertyExists(String propertyPath, String groupId, String artifactId, String version) {
this.propertyPath = propertyPath;
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
}
Beta Was this translation helpful? Give feedback.
All reactions