[
https://issues.apache.org/jira/browse/MDEPLOY-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552942#comment-17552942
]
Nélson Cunha commented on MDEPLOY-293:
--------------------------------------
Here you go:
{noformat}
PS C:\Users\ncunha\Documents\XXX>
$env:MAVEN_OPTS='-Dorg.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient=debug'
PS C:\Users\ncunha\Documents\XXX> mvn deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] XXX [pom]
[INFO] XXX [jar]
[INFO] XXX [jar]
[INFO] XXX [jar]
[INFO] XXX [jar]
[INFO] XXX [jar]
[INFO]
[INFO] ---------< xxx.xxx.xxx:xxx-xxx-xxx >---------
[INFO] Building XXX 4.0.0-SNAPSHOT [1/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ xxx-xxx-xxx
---
[INFO] Installing C:\Users\ncunha\Documents\XXX\pom.xml to
C:\Users\ncunha\.m2\repository\xxx\xxx\xxx\4.0.0-SNAPSHOT\xxx-xxx-xxx-4.0.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:3.0.0-M2:deploy (default-deploy) @ xxx-xxx-xxx
---
Downloading from nexus-snapshots:
http://xxx.xxx.com/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
[DEBUG] CookieSpec selected: compatibility
[DEBUG] Connection request: [route: {}->http://xxx.xxx.com:80][total available:
0; route allocated: 0 of 20; total allocated: 0 of 40]
[DEBUG] Connection leased: [id: 0][route: {}->http://xxx.xxx.com:80][total
available: 0; route allocated: 1 of 20; total allocated: 1 of 40]
[DEBUG] Opening connection {}->http://xxx.xxx.com:80
[DEBUG] Connecting to xxx.xxx.com/172.21.2.99:80
[DEBUG] Connection established 10.69.72.147:63776<->172.21.2.99:80
[DEBUG] http-outgoing-0: set socket timeout to 1800000
[DEBUG] Executing request GET
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
HTTP/1.1
[DEBUG] Target auth state: UNCHALLENGED
[DEBUG] Proxy auth state: UNCHALLENGED
[DEBUG] http-outgoing-0 >> GET
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
HTTP/1.1
[DEBUG] http-outgoing-0 >> Cache-control: no-cache
[DEBUG] http-outgoing-0 >> Pragma: no-cache
[DEBUG] http-outgoing-0 >> User-Agent: Apache-Maven/3.8.5 (Java 1.8.0_321;
Windows 10 10.0)
[DEBUG] http-outgoing-0 >> Host: xxx.xxx.com
[DEBUG] http-outgoing-0 >> Connection: Keep-Alive
[DEBUG] http-outgoing-0 >> Accept-Encoding: gzip,deflate
[DEBUG] http-outgoing-0 << HTTP/1.1 401 Unauthorized
[DEBUG] http-outgoing-0 << Date: Fri, 10 Jun 2022 19:21:21 GMT
[DEBUG] http-outgoing-0 << Server: Nexus/3.16.2-01 (OSS)
[DEBUG] http-outgoing-0 << X-Content-Type-Options: nosniff
[DEBUG] http-outgoing-0 << Content-Security-Policy: sandbox allow-forms
allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
[DEBUG] http-outgoing-0 << X-XSS-Protection: 1; mode=block
[DEBUG] http-outgoing-0 << WWW-Authenticate: BASIC realm="Sonatype Nexus
Repository Manager"
[DEBUG] http-outgoing-0 << Content-Length: 0
[DEBUG] Connection can be kept alive indefinitely
[DEBUG] Authentication required
[DEBUG] xxx.xxx.com:80 requested authentication
[DEBUG] Authentication schemes in the order of preference: [Negotiate,
Kerberos, NTLM, CredSSP, Digest, Basic]
[DEBUG] Challenge for Negotiate authentication scheme not available
[DEBUG] Challenge for Kerberos authentication scheme not available
[DEBUG] Challenge for NTLM authentication scheme not available
[DEBUG] Challenge for CredSSP authentication scheme not available
[DEBUG] Challenge for Digest authentication scheme not available
[DEBUG] Selected authentication options: [BASIC [complete=true]]
[DEBUG] http-outgoing-0: set socket timeout to 1800000
[DEBUG] Executing request GET
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
HTTP/1.1
[DEBUG] Target auth state: CHALLENGED
[DEBUG] Generating response to an authentication challenge using basic scheme
[DEBUG] Proxy auth state: UNCHALLENGED
[DEBUG] http-outgoing-0 >> GET
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
HTTP/1.1
[DEBUG] http-outgoing-0 >> Cache-control: no-cache
[DEBUG] http-outgoing-0 >> Pragma: no-cache
[DEBUG] http-outgoing-0 >> User-Agent: Apache-Maven/3.8.5 (Java 1.8.0_321;
Windows 10 10.0)
[DEBUG] http-outgoing-0 >> Host: xxx.xxx.com
[DEBUG] http-outgoing-0 >> Connection: Keep-Alive
[DEBUG] http-outgoing-0 >> Accept-Encoding: gzip,deflate
[DEBUG] http-outgoing-0 >> Authorization: Basic bmN1bmhhOsKjUGFzc3dvcmQx
[DEBUG] http-outgoing-0 << HTTP/1.1 404
xxx/xxx/xxx/4.0.0-SNAPSHOT/maven-metadata.xml
[DEBUG] http-outgoing-0 << Date: Fri, 10 Jun 2022 19:21:21 GMT
[DEBUG] http-outgoing-0 << Server: Nexus/3.16.2-01 (OSS)
[DEBUG] http-outgoing-0 << X-Content-Type-Options: nosniff
[DEBUG] http-outgoing-0 << Content-Security-Policy: sandbox allow-forms
allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
[DEBUG] http-outgoing-0 << X-XSS-Protection: 1; mode=block
[DEBUG] http-outgoing-0 << Pragma: no-cache
[DEBUG] http-outgoing-0 << Cache-Control: post-check=0, pre-check=0
[DEBUG] http-outgoing-0 << Expires: 0
[DEBUG] http-outgoing-0 << Content-Type: text/html
[DEBUG] http-outgoing-0 << Content-Length: 2057
[DEBUG] Connection can be kept alive indefinitely
[DEBUG] Authentication succeeded
[DEBUG] Caching 'basic' auth scheme for http://xxx.xxx.com:80
[DEBUG] Connection [id: 0][route: {}->http://xxx.xxx.com:80] can be kept alive
indefinitely
[DEBUG] http-outgoing-0: set socket timeout to 0
[DEBUG] Connection released: [id: 0][route: {}->http://xxx.xxx.com:80][total
available: 1; route allocated: 1 of 20; total allocated: 1 of 40]
Uploading to nexus-snapshots:
http://xxx.xxx.com/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/xxx-xxx-xxx-4.0.0-20220610.192114-1.pom
[DEBUG] CookieSpec selected: compatibility
[DEBUG] Re-using cached 'basic' auth scheme for http://xxx.xxx.com:80
[DEBUG] Connection request: [route: {}->http://xxx.xxx.com:80][total available:
1; route allocated: 1 of 20; total allocated: 1 of 40]
[DEBUG] Connection leased: [id: 0][route: {}->http://xxx.xxx.com:80][total
available: 0; route allocated: 1 of 20; total allocated: 1 of 40]
[DEBUG] http-outgoing-0: set socket timeout to 0
[DEBUG] http-outgoing-0: set socket timeout to 1800000
[DEBUG] Executing request PUT
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/xxx-xxx-xxx-4.0.0-20220610.192114-1.pom
HTTP/1.1
[DEBUG] Target auth state: UNCHALLENGED
[DEBUG] Proxy auth state: UNCHALLENGED
[DEBUG] http-outgoing-0 >> PUT
/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/xxx-xxx-xxx-4.0.0-20220610.192114-1.pom
HTTP/1.1
[DEBUG] http-outgoing-0 >> Cache-control: no-cache
[DEBUG] http-outgoing-0 >> Pragma: no-cache
[DEBUG] http-outgoing-0 >> User-Agent: Apache-Maven/3.8.5 (Java 1.8.0_321;
Windows 10 10.0)
[DEBUG] http-outgoing-0 >> Content-Length: 4515
[DEBUG] http-outgoing-0 >> Host: xxx.xxx.com
[DEBUG] http-outgoing-0 >> Connection: Keep-Alive
[DEBUG] http-outgoing-0 >> Expect: 100-continue
[DEBUG] http-outgoing-0 >> Accept-Encoding: gzip,deflate
[DEBUG] http-outgoing-0 >> Authorization: Basic bmN1bmhhOj9QYXNzd29yZDE=
[DEBUG] http-outgoing-0 << HTTP/1.1 100 Continue
[DEBUG] http-outgoing-0 << HTTP/1.1 401 Unauthorized
[DEBUG] http-outgoing-0 << Date: Fri, 10 Jun 2022 19:21:22 GMT
[DEBUG] http-outgoing-0 << Server: Nexus/3.16.2-01 (OSS)
[DEBUG] http-outgoing-0 << X-Content-Type-Options: nosniff
[DEBUG] http-outgoing-0 << WWW-Authenticate: BASIC realm="Sonatype Nexus
Repository Manager"
[DEBUG] http-outgoing-0 << Content-Length: 0
[DEBUG] Connection can be kept alive indefinitely
[DEBUG] Authentication required
[DEBUG] xxx.xxx.com:80 requested authentication
[DEBUG] Authorization challenge processed
[DEBUG] Authentication failed
[DEBUG] Clearing cached auth scheme for http://xxx.xxx.com:80
[DEBUG] Connection [id: 0][route: {}->http://xxx.xxx.com:80] can be kept alive
indefinitely
[DEBUG] http-outgoing-0: set socket timeout to 0
[DEBUG] Connection released: [id: 0][route: {}->http://xxx.xxx.com:80][total
available: 1; route allocated: 1 of 20; total allocated: 1 of 40]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for XXX 4.0.0-SNAPSHOT:
[INFO]
[INFO] XXX ......................... FAILURE [ 7.227 s]
[INFO] XXX ......................... SKIPPED
[INFO] XXX ......................... SKIPPED
[INFO] XXX ......................... SKIPPED
[INFO] XXX ......................... SKIPPED
[INFO] XXX ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.643 s
[INFO] Finished at: 2022-06-10T20:21:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M2:deploy (default-deploy)
on project xxx-xxx-xxx: ArtifactDeployerException: Failed to deploy artifacts:
Could not transfer artifact xxx.xxx.xxx:xxx-xxx-xxx:pom:4.0.0-20220610.192114-1
from/to nexus-snapshots (http://xxx.xxx.com/repository/maven-snapshots/):
authentication failed for
http://xxx.xxx.com/repository/maven-snapshots/xxx/xxx/xxx/4.0.0-SNAPSHOT/xxx-xxx-xxx-4.0.0-20220610.192114-1.pom,
status: 401 Unauthorized -> [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
PS C:\Users\ncunha\Documents\XXX>
{noformat}
> Maven deploy fails with 401 Unauthorized when using £ in password
> -----------------------------------------------------------------
>
> Key: MDEPLOY-293
> URL: https://issues.apache.org/jira/browse/MDEPLOY-293
> Project: Maven Deploy Plugin
> Issue Type: Bug
> Reporter: Nélson Cunha
> Priority: Major
> Fix For: waiting-for-feedback, wontfix-candidate
>
> Attachments: image-2022-06-08-20-06-39-388.png,
> image-2022-06-08-20-09-57-536.png, image-2022-06-09-16-52-04-876.png,
> image-2022-06-09-16-52-19-905.png, image-2022-06-09-17-01-18-568.png
>
>
> Hello.
> I'm using Apache Maven 3.6.3 and maven-deploy-plugin 2.8.2 on Oracle's Java
> version 1.8.0_321 and I'm currently receiving the 401 Unauthorized error
> when deploying an artifact to Sonatype Nexus:
> {noformat}
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on
> project XXX: Failed to deploy artifacts: Could not transfer artifact
> XXX:XXX:pom:4.0.0-20220608.184337-1 from/to nexus-snapshots
> (http://.../repository/maven-snapshots/): Transfer failed for
> http://...-4.0.0-20220608.184337-1.pom 401 Unauthorized -> [Help 1]{noformat}
>
> This error showed up after I changed my password with a leading {{£}}
> character.
>
> Using Wireshark to capture the HTTP packages exchanged between the maven
> client and the nexus repository, I see 3 interactions:
> # unauthenticated GET request for a maven-metadata.xml file, followed by a
> 401 response
> # authenticated GET request for the same maven-metadata.xml file, followed
> by a 404 response
> # authenticated PUT request for the pom file, followed by a 401 response
>
> Now, analyzing the headers for the second and third request I noticed the
> base64 on the Authentication header is not the same.
> * 2nd request: GET metadata
> !image-2022-06-08-20-06-39-388.png!
>
> * 3rd request PUT pom
> !image-2022-06-08-20-09-57-536.png!
>
> The decoded base64 with the username:password, shows that, as expected, the
> request that received a 404 holds the right password, but on the other hand,
> the PUT request that got a 401 has a password with a {{?}} for the {{{}£{}}}.
>
> All the servers on my {{settings.xml}} hold the same user/password and I have
> tried with the passwords encoded and in plain text.
>
>
> Further tests with base64 encoding and decoding showed that the "wrong"
> password is the actual password but encoded from an ANSI code page where the
> password accepted by Nexus is encoded from utf8.
>
> I noticed the 401 responses don't specify the encoding on the
> {{WWW-Authenticate}} header, which should clear up which encoding to use, but
> still for some reason the two requests are apparently using different
> encodings.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)