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

Fallback to the original registry repo config in case applied mirror/proxy from settings didn't work #19693

Merged

Conversation

aloubyansky
Copy link
Member

@aloubyansky aloubyansky commented Aug 26, 2021

This change provides a better user experience when Maven mirrors and/or proxies are present in the local Maven settings.

ADDING A * MIRROR

    <mirror>
        <id>aliyunmaven</id>
        <mirrorOf>*</mirrorOf>
        <name>阿里云公共仓库</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  1. For registry.quarkus.io:

1.2. Maven plugin:

[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:create (default-cli) @ standalone-pom ---
[WARNING] The POM for io.smallrye.config:smallrye-config:jar:2.4.4 is missing, no dependency information available
[WARNING] Failed to resolve the Quarkus extension registry descriptor of registry.quarkus.io from aliyunmaven (https://maven.aliyun.com/repository/public) having applied the mirrors and/or proxies from the Maven settings to registry.quarkus.io (https://registry.quarkus.io/maven). Re-trying with the original registry.quarkus.io repository configuration.
[INFO] Looking for the newly published extensions in registry.quarkus.io
Set the project groupId [org.acme]: 
  1. Non-existing registry.playground.io

2.1. Maven plugin:

[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:create (default-cli) @ standalone-pom ---
[WARNING] The POM for io.smallrye.config:smallrye-config:jar:2.4.4 is missing, no dependency information available
[WARNING] Failed to resolve the Quarkus extension registry descriptor of registry.playground.io from aliyunmaven (https://maven.aliyun.com/repository/public) having applied the mirrors and/or proxies from the Maven settings to registry.playground.io (https://registry.playground.io/maven). Re-trying with the original registry.playground.io repository configuration.
[WARNING] Could not transfer metadata io.playground.registry:quarkus-registry-descriptor:1.0-SNAPSHOT/maven-metadata.xml from/to registry.playground.io (https://registry.playground.io/maven): transfer failed for https://registry.playground.io/maven/io/playground/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/maven-metadata.xml
[WARNING] The extension catalog will be narrowed to the io.quarkus:quarkus-bom:999-SNAPSHOT platform release. To enable the complete Quarkiverse extension catalog along with the latest recommended platform releases, please, make sure the following registries are accessible from your environment: registry.playground.io
Set the project groupId [org.acme]: 

2.2. CLI:

[aloubyansky@localhost test]$ qs create
Creating an app (default project type, see --help).
[WARN] 🔥  Failed to resolve the Quarkus extension registry descriptor of registry.playground.io from aliyunmaven (https://maven.aliyun.com/repository/public) having applied the mirrors and/or proxies from the Maven settings to registry.playground.io (https://registry.playground.io/maven). Re-trying with the original registry.playground.io repository configuration.
[WARN] 🔥  Configured Quarkus extension registries appear to be unavailable at the moment. It should still be possible to create a project by providing the groupId:artifactId:version of the desired Quarkus platform BOM, e.g. 'quarkus create -P io.quarkus.platform:quarkus-bom:999-SNAPSHOT'
[ERROR] ❗  Unable to create project: Failed to resolve the Quarkus extension registry descriptor of registry.playground.io from registry.playground.io (https://registry.playground.io/maven)
  1. Interestingly I caught a moment when 2.1.4.Final became available in the Central but not in the Chinese mirror, resulting in

3.1. CLI error:

[aloubyansky@localhost test]$ qs create
Creating an app (default project type, see --help).
[WARN] 🔥  Failed to resolve the Quarkus extension registry descriptor of registry.quarkus.io from aliyunmaven (https://maven.aliyun.com/repository/public) having applied the mirrors and/or proxies from the Maven settings to registry.quarkus.io (https://registry.quarkus.io/maven). Re-trying with the original registry.quarkus.io repository configuration.
Looking for the newly published extensions in registry.quarkus.io
[ERROR] ❗  Unable to create project: Failed to resolve Quarkus extensions catalog io.quarkus.platform:quarkus-bom-quarkus-platform-descriptor:json:2.1.4.Final:2.1.4.Final

3.2. Maven plugin error:

[aloubyansky@localhost test]$ mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:create (default-cli) @ standalone-pom ---
[WARNING] The POM for io.smallrye.config:smallrye-config:jar:2.4.4 is missing, no dependency information available
[WARNING] Failed to resolve the Quarkus extension registry descriptor of registry.quarkus.io from aliyunmaven (https://maven.aliyun.com/repository/public) having applied the mirrors and/or proxies from the Maven settings to registry.quarkus.io (https://registry.quarkus.io/maven). Re-trying with the original registry.quarkus.io repository configuration.
[INFO] Looking for the newly published extensions in registry.quarkus.io
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.919 s
[INFO] Finished at: 2021-08-26T15:46:43+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create (default-cli) on project standalone-pom: Failed to resolve the extensions catalog: Failed to resolve Quarkus extensions catalog io.quarkus.platform:quarkus-optaplanner-bom-quarkus-platform-descriptor:json:2.1.4.Final:2.1.4.Final: Failed to resolve artifact io.quarkus.platform:quarkus-optaplanner-bom-quarkus-platform-descriptor:json:2.1.4.Final:2.1.4.Final: Could not find artifact io.quarkus.platform:quarkus-optaplanner-bom-quarkus-platform-descriptor:json:2.1.4.Final:2.1.4.Final in aliyunmaven (https://maven.aliyun.com/repository/public) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

…proxy from settings didn't work, better logs
@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus area/maven area/platform Issues related to definition and interaction with Quarkus Platform labels Aug 26, 2021
@aloubyansky
Copy link
Member Author

@gastaldi The mirror sync error makes me think our registry should be also providing the platform JSON catalogs we deploy to Central.

@gastaldi
Copy link
Contributor

@gastaldi The mirror sync error makes me think our registry should be also providing the platform JSON catalogs we deploy to Central.

@aloubyansky can you elaborate on why the registry should do that if the JSON is already published in central?

@aloubyansky
Copy link
Member Author

Some users/organizations setup mirrors for central. They will be synced periodically but there will be an out-of-sync interval at some point when a new catalog has been published to Central but not yet available in the mirror. Our registry will recommend that catalog but it won't be available in the mirror yet and will cause the client to fail.

@gastaldi
Copy link
Contributor

It sounds like it's the mirror's fault for not synchronizing yet? I am not 100% convinced we should be adding that feature to the registry because:

  • Even if we provide that information, the other artifacts needed to build the project won't be available yet (other POMs and JARs) so it's still the same problem.
  • Mirrors (at least the ones using Nexus I know they do) reach Central when artifacts are missing
  • The platform JSON that is published is not stored in the Registry database, so that means we'll have to assemble it from scratch from the stored data in the DB tables (which might differ - the order, even slightly - from the one in central).

@maxandersen
Copy link
Member

@gastaldi this is not a change in the registry - its the client going directly to registry if mirror/proxy access fail, right ?

@aloubyansky
Copy link
Member Author

No, it happens when it resolves the https://repo1.maven.org/maven2/io/quarkus/quarkus-bom-quarkus-platform-descriptor/2.1.4.Final. These aren't provided by the registry.

@aloubyansky
Copy link
Member Author

The fact that the JARs won't be available in that case anyway, makes it look less like a fix.

@aloubyansky
Copy link
Member Author

#19695 reports a better message in case of 3

Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus area/maven area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants