Reputation: 13
I am trying to build Quarkus behind a corporate firewall, while maven runs fine on my personal computer, maven returns "Forbidden" errors when I try to do a build on my corporate laptop. I suspect there could be a proxy issue, and if so, how to change the settings.xml for Maven builds? Here is the latest example:
[INFO] --- quarkus-maven-plugin:3.0.3.Final:create (default-cli) @ standalone-pom ---
[WARNING] Could not transfer metadata io.quarkus.registry:quarkus-registry-descriptor:1.0-SNAPSHOT/maven-metadata.xml from/to nexus-public (https://widget/artifactory/maven-mirror): authorization failed for https://widget/artifactory/maven-mirror/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/maven-metadata.xml, status: 403 Forbidden
[INFO] Looking for the newly published extensions in registry.quarkus.io
[WARNING] Could not transfer metadata io.quarkus.registry:quarkus-platforms:1.0-SNAPSHOT/maven-metadata.xml from/to nexus-public (https://widget/artifactory/maven-mirror): authorization failed for https://widget/artifactory/maven-mirror/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/maven-metadata.xml, status: 403 Forbidden
[WARNING] Quarkus extension registry registry.quarkus.io did not provide any extension catalog
I was able to create a local repo to avoid the corporate firewall/proxy, but I now hit an error when I try to build a fresh project or add an extension. The issue seems to be with registry.quarkus.io to lookup Quarkus extensions:
$ ../apache-maven-${GITLAB_MVN_VERSION}/bin/mvn io.quarkus.platform:quarkus-maven-plugin:3.0.3.Final:create -DprojectGroupId=com.acme -DprojectArtifactId=openshift-quickstart -Dextensions='quarkus-resteasy-reactive,quarkus-openshift' --settings ../settings.xml install -Dmaven.repo.local=./repository -Dmaven.wagon.http.ssl.insecure=true
144[INFO] Scanning for projects...
145[INFO]
146[INFO] ---------------< com.truist.digital:alert-notification >----------------
147[INFO] Building alert-notification 1.0.1-SNAPSHOT
148[INFO] --------------------------------[ jar ]---------------------------------
149[INFO]
150[INFO] --- quarkus-maven-plugin:3.0.3.Final:create (default-cli) @ alert-notification ---
151[WARNING] Could not transfer metadata io.quarkus.registry:quarkus-registry-descriptor:1.0-SNAPSHOT/maven-metadata.xml from/to nexus-public (https://widget/artifactory/maven-mirror): authentication failed for https://widget/artifactory/maven-mirror/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.0.3.Final:create (default-cli) on project testproject: Execution default-cli of goal io.quarkus.platform:quarkus-maven-plugin:3.0.3.Final:create failed: Failed to deserialize registries descriptor /builds/poc/testproject/titan-bau/./repository/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/quarkus-registry-descriptor-1.0-SNAPSHOT.json: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
So there are 2 issues: (1) the Forbidden errors preventing access to remote Maven repos, and (2) Unauthorized error when trying to create a new Quarkus project or add an extension after a local maven repo was built. Any help would be appreciated, this is becoming a major roadblock for this project.
Upvotes: 0
Views: 1040
Reputation: 3890
We have documentation at https://quarkus.io/guides/extension-registry-user documenting how to use the registry - give that a read.
For your specific issues:
Looks like maven downloaded an artifact at /builds/poc/testproject/titan-bau/./repository/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/quarkus-registry-descriptor-1.0-SNAPSHOT.json
that is containing whatever your firewall/proxy returned rather than the actual content.
You should start by deleting that file. It is an unfortunate side-effect of having a proxy that is returning 200 OK when it really should return 401 not found or even 403 not authorized.
It would be great if you could open github issue on how you got that file as we should see if we could ensure that does not happen.
Also, it seems you have auth settings setup to access nexus-public - but they are not working? Might again just be a proxy/firewall issue but weird it is even being accessed?
To solve it there are multiple options dependent on what your corporate network policy:
If you are allowed to access registry.quarkus.io via a firewall/proxy then make sure you have such setup. How, depends on your company policies but one way is to set it up in maven settings.xml as describe at https://maven.apache.org/guides/mini/guide-proxies.html
If you are NOT allowed to access registry.quarkus.io but okey with code.quarkus.io - then you can as alternative use that to create starter projects or if that is not an option either try starting with projects from github.com/quarkusio/quarkus-quickstarts/ - not great; but if your corporate environment does not allow any access our/your options are limited.
Finally, you can also tell quarkus to not look at registries by disabling them - see https://quarkus.io/guides/extension-registry-user and Quarkus should then fallback to use what is in the core quarkus platform.
This of course means Quarkus can't get greatest and latest info but if you are running behind corporate firewall disallowing that there is not much we can do about that.
Upvotes: 1
Reputation: 398
We are aware of the issue (it was reported in https://github.com/quarkusio/quarkus/issues/33220) and are working on a fix. In the meantime, as a workaround, you could create new projects using the last 2.16 tools, for example
mvn io.quarkus:quarkus-maven-plugin:2.16.7.Final:create
Upvotes: 1