Skip to content

Can't overwrite dependency defined in the rewrite-maven-plugin #7091

@qwtfps

Description

@qwtfps

What version of OpenRewrite are you using?

I am using

  • OpenRewrite v6.28.0
  • Maven/Gradle plugin v3.9.6

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
  <groupId>org.openrewrite.maven</groupId>
  <artifactId>rewrite-maven-plugin</artifactId>
  <version>1.2.3</version>
  <configuration>
     <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-spring</artifactId>
            <version>5.23.0</version>
          </dependency>
  </configuration>
</plugin>

What is the smallest, simplest way to reproduce the problem?

What did you expect to see?

when using command to exec plugin like

 mvn  org.openrewrite.maven:rewrite-maven-plugin:6.28.0:run  -Drewrite.recipeArtifactCoordinates=xxx   -Drewrite.activeRecipes=xxxx

I need using rewrite-spring 6+ which in higher than in the pom .
I tried to add option -Ddependencies=org.openrewrite.recipe:rewrite-spring:6.23.0 for overwrite but it is not help (We can't change pom directly in our case)

What did you see instead?

Due to the version incompatible , I got

class org.openrewrite.java.spring.data.RefactorSimpleMongoDbFactory cannot be cast to class org.openrewrite.Recipe (org.openrewrite.java.spring.data.RefactorSimpleMongoDbFactory and org.openrewrite.Recipe

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions