-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
defaultRegistryUrls does not work when the manager provides a custom defaultUrl #13925
Comments
From our
It looks like we hard-code a path to the maven registry in the Maven manager code: renovate/lib/manager/maven/extract.ts Line 60 in 3481d38
I think the code wouldn't reach the
Are you sure you're using the right config option? Maybe you actually need the Footnotes |
My use case is a combination of different options. I contributed a PR to be able to extract maven registries from a settings.xml in #13592 My feature mitigates that, so that I now do not need to define If I remove the So we introduced The problem is that the maven manager adds a default registry to all packages as you noticed. |
I don't think that's a reasonable expectation. If you want to look up in both, you'd need both configured in
This part is not intended.
I'm not sure we need this because the datasource already has it: renovate/lib/datasource/maven/index.ts Line 27 in 493fd75
Instead, I'd prefer that we fix the maven manager by not inserting a default registry into |
If we do that, we break all repos, that have neither We can only do that if we provide a default |
The maven datasource already has defaultRegistryUrls. Wouldn't it still work fine? |
Not sure, need to test that first. |
It is at least not being used in the maven datasource as far as I can see. 🤔 |
It's used by the datasource index code prior to passing to the datasource implementation itself. Take a look at the code I modified in the recent PR because it's part of that |
You are correct, that should work. So we just need to remove the default maven central url from the extraction phase. |
🎉 This issue has been resolved in version 31.66.6 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Reopened due to #14057 |
From my reading of the Maven 3.8.4 code, one can prevent the use of Maven Central by declaring a repository in the POM and using the ID "central". <?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.astellin</groupId>
<artifactId>prove-13950-is-bad</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>central</id>
<name>OT Artifactory Releases Repo</name>
<url>https://astellin.io/artifactor/does-not-exist</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project> results in
|
yes, that is also my understanding. Ok, here is a quick overview of my understanding on how Maven works.
What we need to do is the following:
I am not sure yet how we can add the |
I still think that For
Alternatively, because this is such a special use case (which only I would be using) we should disable In that case I would still improve the extraction from the settings.xml to be more robust. |
TLDR:
@rarkins @astellingwerf Any opinions on that? |
I'm not too aware of the implementation of |
Afaik the reason we are not using maven for the pom parsing/generation is that Renovate is much faster with the typescript implementation, although not that feature rich. |
Yeah, we now have zero calls to |
OK, fair enough, but that means that the cost is to reimplement Maven's POM parsing logic in Renovate (or reuse a npm package that can do it?). |
I don't think we necessarily need to pass the global pom if the only field we care about is the default repository and we already know what it contains |
Hi there, Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction. We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
When a bug has been marked as needing a reproduction, it means nobody can work on it until one is provided. In cases where no reproduction is possible, or the issue creator does not have the time to reproduce, we unfortunately need to close such issues as they are non-actionable and serve no benefit by remaining open. This issue will be closed after 7 days of inactivity. |
This bug report has been closed as we need a reproduction to work on this. If the original poster or anybody else with the same problem discovers that they can reproduce it, please create a new issue, and reference this issue. |
How are you running Renovate?
Self-hosted
If you're self-hosting Renovate, tell us what version of Renovate you run.
0.0.0-semantic-release (so current main branch)
Please select which platform you are using if self-hosting.
GitHub Enterprise Server
If you're self-hosting Renovate, tell us what version of the platform you run.
doesn't matter
Was this something which used to work for you, and then stopped?
I never saw this working
Describe the bug
Assuming the following config:
In that case the following is expected:
What happens is that Renovate will only lookup in maven central.
Reason:
The maven manager add the maven central repo as default to the dependency as seen here:
https://github.com/renovatebot/renovate/blob/main/lib/manager/maven/extract.ts#L60-L66
Result:
The result is that
defaultRegistries
will not work with maven as manager.Remediation:
defaultRegistryUrls
(this may need additional code).Relevant debug logs
No response
Have you created a minimal reproduction repository?
No reproduction repository
The text was updated successfully, but these errors were encountered: