Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MagicalAsh opened this issue Oct 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MagicalAsh
Copy link
Contributor

MagicalAsh commented Oct 5, 2023

What version of OpenRewrite are you using?

I am using

  • OpenRewrite v8.6.1
  • Maven/Gradle plugin v6.3.11

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.

@MagicalAsh MagicalAsh added the bug Something isn't working label Oct 5, 2023
timtebeek pushed a commit that referenced this issue Oct 10, 2023
This commit fixes issue #233, where specifying a
rewriteVersion inside the rewrite configuration block
would result in rewrite-polyglot failing to resolve
to a proper version.

Co-authored-by: Wesley Rogers <[email protected]>
@timtebeek
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants