Dockerfile-maven: Plugin fails when settings.xml contains an encrypted password that was not encrypted via maven tools.

Created on 9 Aug 2018  路  3Comments  路  Source: spotify/dockerfile-maven

BUG REPORT

Description

When using version 1.4.4 of the plugin and pushing/pulling an image from a private repository with useMavenSettingsForAuth set to true the plugin will fail if it thinks the password provided in settings.xml is encrypted by maven when it's actually not.

How to reproduce

Configure the plugin with useMavenSettingsForAuth set to true. Inside the settings.xml create a server definition like below:

<server>
  <id>docker-repo.example.com:8080</id>
  <username>user</username> 
  <password>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</password>
</server>

Where the password is a string that is encrypted but NOT encrypted using the maven master key. The example above is a JWT.

Then attempt to build or push an image that interacts with the specified server using the plugin and you will be met with an error.

What do you expect

I would expect that if the plugin cannot decrypt the password using the maven key in settings-security.xml or the settings-security.xml does not exist that a warning/info lvl message will be displayed in the log that it thought the password was encrypted but was unsuccessful in decrypting it. I would expect that the plugin continue by sending the password as is (no decryption).

What happened instead

Plugin errors with:

[ERROR] Settings problem for server [redacted]: [ERROR] Failed to decrypt password for server [redacted]: org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: java.io.FileNotFoundException: /home/jenkins/.m2/settings-security.xml (No such file or directory) @ server: [redacted]

Software:

  • docker version: N/A
  • Spotify's dockerfile-maven version: 1.4.4

Full backtrace

See above.

stale

Most helpful comment

This is still an issue. Please re-open.

All 3 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is still an issue. Please re-open.

@blindenvy I think this is a Maven problem. See update 2 in this StackOverflow question.

Was this page helpful?
0 / 5 - 0 ratings