You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a Recipe using Java-Code that adds Maven-Dependencies dependent on two conditions.
is a company specific config set in a config-file
is the dependency used in the current pom.xml
My Problem is that its not possible to use Preconditions in the getRecipeList()-Method of a Recipe but in the getVisitors()-Method where its not possible to return e.g. the AddDependency-Recipe but only its Visitor. That means the Scanning-Logic is never applied and the Recipe is not beheaving as expected.
Is there a Solution to this Problem or is our approach just the wrong one?
this is how the getVisitor()-Method works
Preconditions.check(
Preconditions.and(
Preconditions.not(
newFindKey("$.my_config").getVisitor()),
// Prüfung auf Vorhandensein der notw. DependencynewFindDependency(groupId, artifactId, null,"").getVisitor()
),
newAddDependency(
....
).getVisitor());
this is how I would like to use it
Preconditions.check(
Preconditions.and(
Preconditions.not(
newFindKey("$.my_config").getVisitor()),
// Prüfung auf Vorhandensein der notw. DependencynewFindDependency(groupId, artifactId, null,"").getVisitor()
),
newAddDependency(
....
));
I am using
I am trying to create a Recipe using Java-Code that adds Maven-Dependencies dependent on two conditions.
My Problem is that its not possible to use Preconditions in the
getRecipeList()
-Method of a Recipe but in thegetVisitors()
-Method where its not possible to return e.g. theAddDependency
-Recipe but only its Visitor. That means the Scanning-Logic is never applied and the Recipe is not beheaving as expected.Is there a Solution to this Problem or is our approach just the wrong one?
this is how the
getVisitor()
-Method worksthis is how I would like to use it
Are you interested in contributing a fix to OpenRewrite?
The text was updated successfully, but these errors were encountered: