Skip to content

UpdateMavenWrapper does not work when the distributionUrl requires credentials #5046

Open
@tylervangorder-8451

Description

What version of OpenRewrite are you using?

I am using

  • OpenRewrite v8.44.1
  • Maven Plugin 6.0.5

How are you running OpenRewrite?

Running maven plugin on a single pom.xml project.

The issue

We are attempting to use the UpdateMavenWrapper recipe to add/update the maven wrapper and specifying the follow:

type: specs.openrewrite.org/v1beta/recipe
name: com.recipe.name.Here
displayName: Add or Update Maven Wrapper
description: Add or update the Maven Wrapper for a project.
recipeList:
  - org.openrewrite.maven.UpdateMavenWrapper:
      wrapperDistribution: only-script
      wrapperVersion: 3.3.1
      addIfMissing: true
      distributionVersion: 3.9.x
      repositoryUrl: "https://company-hosted-artifactory-url"

We do not allow any downloads from Maven central and use an Artifactory mirror.

The problem with this recipe is that it is creating a Remote source file using repositoryUrl but has no knowledge of the credentials and fails here:

https://github.com/openrewrite/rewrite/blob/main/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java#L134-L135

This recipe really needs to be Maven Settings-aware (and probably should be using the MavenArtifactDownloader to download the distribution)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status

      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions