openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
60 stars 37 forks source link

Make checkstyle an optional dependency #188

Closed nomisRev closed 1 year ago

nomisRev commented 1 year ago

Currently the Gradple plugin forces to include checkstyle. This PR only adds it in the Dependencies[] to resolve when the version is not null.

Without it running the rewriteRun task results in:

Execution failed for task ':rewriteResolveDependencies'.
> Could not resolve all dependencies for configuration ':detachedConfiguration5'.
  The project declares repositories, effectively ignoring the repositories you have declared in the settings.
  You can figure out how project repositories are declared by configuring your build to fail on project repositories.
  See https://docs.gradle.org/8.0.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
   > Could not find com.puppycrawl.tools:checkstyle:null.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/puppycrawl/tools/checkstyle/null/checkstyle-null.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :
madorb commented 1 year ago

Running into this issue as well

shanman190 commented 1 year ago

@nomisRev, with #189 resolved do you feel that this is still necessary?

nomisRev commented 1 year ago

@shanman190, no this is not necessary at all anymore! Closing this PR ☺️