You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "cstamas (via GitHub)" <gi...@apache.org> on 2026/05/27 10:15:43 UTC

[PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

cstamas opened a new pull request, #1891:
URL: https://github.com/apache/maven-resolver/pull/1891

   Some servers have issues handling it (esp the Accept HTTP header), so make it possible to disable it. Moreover, the new config accepts REPO_ID suffix, so this can happen per-server basis.
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [ ] Your pull request should address just one issue, without pulling in other changes.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
     Note that commits might be squashed by a maintainer on merge.
   - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
     This may not always be possible but is a best-practice.
   - [ ] Run `mvn verify` to make sure basic checks pass.
     A more thorough check will be performed on your pull request automatically.
   - [ ] You have run the integration tests successfully (`mvn -Prun-its verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891#issuecomment-4553945008

   Also, in this very case, it just happens that we use a REST endpoint of an older software. Usually, Resolver transport is hitting non REST.
   
   And this happens ONLY as nx2 offered "transparent support" for maven-deploy-plugin, while deployment to staging was always possible via alternate means (native plugin or so).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891#discussion_r3310355326


##########
maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java:
##########
@@ -596,6 +596,26 @@ public final class ConfigurationProperties {
      */
     public static final boolean DEFAULT_VERSION_SCHEME_CACHE_DEBUG = false;
 
+    /**
+     * Boolean flag should the HTTP transport support RFC 9457 messages. Some servers have issues with handling the
+     * HTTP Accept headers, when support is enabled. Known servers not supporting RFC 9457 is for
+     * example Sonatype Nexus 2.
+     *
+     * @since 2.0.19
+     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
+     * @configurationType {@link java.lang.Boolean}
+     * @configurationDefaultValue {@link #DEFAULT_HTTP_SUPPORT_RFC9457}
+     * @configurationRepoIdSuffix Yes
+     */
+    public static final String HTTP_SUPPORT_RFC9457 = PREFIX_TRANSPORT_HTTP + "supportRfc9457";

Review Comment:
   This and @slawekjaranowski comment below makes sense, this config should be ONLY about `Accept` header, and then as Slawek says below, just always parse response?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control sending RFC 9457 related Accept HTTP header [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas merged PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891#issuecomment-4553937737

   > In addition we need to add Accept for regular content (either wildcard for all requests or xml/binary depending on whether it is metadata or artifacts) when we add the accept for problem+json
   
   I find this problematic: adding xml or json or any other Accept is not right; transport is only about _artifacts_, and as we know, servers knows to be picky. So, ideally I'd just modific the text of this config param (it is ONLY about adding Accept to fully support RFC 9457), because _historically_ Resolver _never sent any Accept header at all_.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891#discussion_r3310350433


##########
maven-resolver-transport-apache/src/main/java/org/eclipse/aether/transport/apache/ApacheTransporter.java:
##########
@@ -523,10 +530,23 @@ private <T extends HttpUriRequest> void resume(T request, GetTask task) throws I
     private void handleStatus(CloseableHttpResponse response) throws Exception {
         int status = response.getStatusLine().getStatusCode();
         if (status >= 300) {
-            ApacheRFC9457Reporter.INSTANCE.generateException(response, (statusCode, reasonPhrase) -> {
-                throw new HttpResponseException(statusCode, reasonPhrase + " (" + statusCode + ")");
-            });
+            if (supportRfc9457) {
+                ApacheRFC9457Reporter.INSTANCE.generateException(response, (statusCode, reasonPhrase) -> {
+                    throw new HttpResponseException(statusCode, reasonPhrase + " (" + statusCode + ")");
+                });

Review Comment:
   maybe we can always parse response?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Configuration to be able to control whether RFC 9457 is supported [maven-resolver]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #1891:
URL: https://github.com/apache/maven-resolver/pull/1891#discussion_r3310284012


##########
maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java:
##########
@@ -596,6 +596,26 @@ public final class ConfigurationProperties {
      */
     public static final boolean DEFAULT_VERSION_SCHEME_CACHE_DEBUG = false;
 
+    /**
+     * Boolean flag should the HTTP transport support RFC 9457 messages. Some servers have issues with handling the
+     * HTTP Accept headers, when support is enabled. Known servers not supporting RFC 9457 is for
+     * example Sonatype Nexus 2.
+     *
+     * @since 2.0.19
+     * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
+     * @configurationType {@link java.lang.Boolean}
+     * @configurationDefaultValue {@link #DEFAULT_HTTP_SUPPORT_RFC9457}
+     * @configurationRepoIdSuffix Yes
+     */
+    public static final String HTTP_SUPPORT_RFC9457 = PREFIX_TRANSPORT_HTTP + "supportRfc9457";

Review Comment:
   This is a confusing comment to me, as this is just about the accept header which is not actually specified in the RFC. I would therefore rather refer to it as EXPLICITLY_ACCEPT_PROBLEM_JSON



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org