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

Local repository is not tried when downloading dependencies, failing download #1047

Open
cfecherolle opened this issue Jul 16, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@cfecherolle
Copy link

Describe the bug
When scanning my project, the Maven part fails because of one the dependencies cannot be downloaded.
This dependency is defined in the multiplatform/lib folder of my project which I'm using as a local repository, and defining like so in my pom.xml:

        <repository>
            <id>multiplatform-local-repository</id>
            <url>file://${project.basedir}/multiplatform/lib/</url>
        </repository>

When building with Maven as I usually do, this works fine, but for some reason the scan does not pick it up as a valid location to find dependencies, it tries other repositories (Maven Central + my other remote repositories definitions) and thus, fails to download the specific dependency from my local repository.

SBM Version
0.15.0

SBM Application
spring-boot-upgrade.jar

To Reproduce
Steps to reproduce the behavior:

  1. Define a pom.xml with a local repository definition like my example above
  2. Create the corresponding folder and Maven nested repository structure and put a dependency (JAR + POM) in it
  3. Declare it as a dependency
  4. Scan the project with spring-boot-upgrade.jar

Expected behavior
All dependencies should be downloaded, including the one from the local repository.

Stacktrace

Caused by: org.openrewrite.maven.MavenDownloadingExceptions
	at org.openrewrite.maven.MavenDownloadingExceptions.append(MavenDownloadingExceptions.java:47)
	at org.openrewrite.maven.tree.MavenResolutionResult.resolveDependencies(MavenResolutionResult.java:184)
	at org.openrewrite.maven.MavenParser.parseInputs(MavenParser.java:124)
	... 19 more
	Suppressed: org.openrewrite.maven.MavenDownloadingException: Unable to download POM. Tried repositories:
https://jitpack.io: HTTP 404
https://repo.maven.apache.org/maven2: HTTP 404
		at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:561)
		at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies(ResolvedPom.java:579)
		at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies(ResolvedPom.java:502)
		at org.openrewrite.maven.tree.MavenResolutionResult.resolveDependencies(MavenResolutionResult.java:179)
		... 20 more

Desktop (please complete the following information):

  • OS: MacOS
  • Version: Sonoma 14.5
    (M2 with Apple Silicon chip)
@cfecherolle cfecherolle added the type: bug Something isn't working label Jul 16, 2024
@gwynlionhart
Copy link

Chiming in to say the same happens for me. Some manner of flag to check local repos, or just automatically check for them when the pom.xml mentions them, would be nice.

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

No branches or pull requests

2 participants