openrewrite / rewrite-maven-plugin

OpenRewrite's Maven plugin.
https://openrewrite.github.io/rewrite-maven-plugin/plugin-info.html
Apache License 2.0
127 stars 67 forks source link

Checkstyle did not work following the docs #76

Closed eisig closed 3 years ago

eisig commented 3 years ago

Did not work follow the doc in https://docs.openrewrite.org/reference/checkstyle Here is the output:

[WARNING] Could not find any Rewrite visitors matching active recipe(s): java.Checkstyle. Double check that you have taken a dependency on the jar containing these recipes.

Here is the config in the root pom.xm:

<dependencies>
    <dependency>
      <groupId>org.openrewrite.recipe</groupId>
      <artifactId>rewrite-spring</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.openrewrite.recipe</groupId>
      <artifactId>rewrite-checkstyle</artifactId>
      <version>2.0.2</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.openrewrite.maven</groupId>
        <artifactId>rewrite-maven-plugin</artifactId>
        <version>2.4.3</version>

        <configuration>
          <activeRecipes>
            <recipe>java.Checkstyle</recipe>
          </activeRecipes>
          <configLocation>${maven.multiModuleProjectDirectory}/rewrite.yml</configLocation>
        </configuration>
      </plugin>
      </plugin>
    </plugins>

rewrite.yml in the project root dir

---
type: specs.openrewrite.org/v1beta/recipe
name: java.Checkstyle
visitors:
  - 'org.openrewrite.checkstyle.*'
configure:
  org.openrewrite.checkstyle.*:
    configFile: ${maven.multiModuleProjectDirectory}/settings/checkstyle/checkstyle.xml
jkschneider commented 3 years ago

Hi @eisig! What is the output of mvn rewrite:discover?

sambsnyd commented 3 years ago

the recipes from rewrite-checkstyle are moving into rewrite-core as part of this issue: https://github.com/openrewrite/rewrite/issues/197

Once that is complete checkstyle will again work as advertised. Sorry for any inconvenience and thanks for reporting!