openrewrite / rewrite-gradle-plugin

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

Specifying a rewriteVersion results in rewriteRun failing to resolve dependencies #233

Closed MagicalAsh closed 11 months ago

MagicalAsh commented 11 months ago

What version of OpenRewrite are you using?

I am using

How are you running OpenRewrite?

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

plugins {
    id 'java'
    id 'org.openrewrite.rewrite'
}

rewrite {
    rewriteVersion = "8.6.1"
}

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

Specifying the rewriteVersion property to be anything other than null causes the issue.

rewrite {
    rewriteVersion = "8.6.1"
}

What did you expect to see?

A successful run of OpenRewrite.

What did you see instead?

An unsuccessful run.

What is the full stack trace of any errors you encountered?

Execution failed for task ':rewriteResolveDependencies'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not find org.openrewrite:rewrite-polyglot:8.6.1.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/openrewrite/rewrite-polyglot/8.6.1/rewrite-polyglot-8.6.1.pom
     Required by:
         project :

Are you interested in contributing a fix to OpenRewrite?

Yes I am, but the Open Source contributions policy at my employer is long, so it may be a while before I'm able to create a pull request. If you decide to take it on directly, here's some info I've managed to dig up:

I can tell you that the problem is here as the rewrite-polyglot version is using the same field as the rest of the rewrite bom, despite rewrite-polyglot being versioned independently.

timtebeek commented 11 months ago

Fixed in