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

Maven settings.xml auth matching #2135

Closed
lionelfleury opened this issue Nov 8, 2019 · 3 comments · Fixed by #2212
Closed

Maven settings.xml auth matching #2135

lionelfleury opened this issue Nov 8, 2019 · 3 comments · Fixed by #2212

Comments

@lionelfleury
Copy link

lionelfleury commented Nov 8, 2019

Environment:

  • Jib version: 1.7.0
  • Build tool: maven 3.6.2
  • OS: macOS and gitlab CI

Description of the issue:
Docker image reference: my-registry:port/image:version

Maven expects <server><id> and <repositories><repository><id> to match. https://maven.apache.org/settings.html

Now, Jib expects <server><id> to match exactly with my-registry:port part of the docker image reference. There is no problem using the : character in <server><id>. The problem is that Maven doesn't like : in <repository><id>. So, it causes a problem when you use both <server> and <repository>.

Expected behavior:
Optionally matching the previous mentioned settings.xml file entry/key without :port part.
Not produce maven to output warning regarding special character... (see log output below)

Steps to reproduce:

  1. edit your ~/.m2/settings.xml file with desired and preferred registry host:port key. For server.id and registries.registry.id keys.
  2. run mvn jib:build or mvn {any_goal}

Log output:

[WARNING] Some problems were encountered while building the effective model for common:jar:HEAD-SNAPSHOT
[WARNING] 'repositories.repository.id' must not contain any of these characters \/:"<>|?* but found :

Additional Information:

I suggest to relax the auth retrieval with maven to not use or optionally ignore the :port part of the docker image reference.
This can let the user choose whatever port the registry he/she wants to open.
Otherwise you have to put a double entry for <server><id> part only to please jib... meaning with the :port included.

@chanseokoh
Copy link
Member

Thanks for filing this!

@lionelfleury
Copy link
Author

Sure! ;)

@chanseokoh chanseokoh added this to the v2.0.0 milestone Jan 7, 2020
chanseokoh added a commit that referenced this issue Jan 15, 2020
* Ignore port as fallback when inferring registry auth from maven settings

Fixes #2135

* Update comment

Co-authored-by: Chanseok Oh <chanseok@google.com>
@TadCordle
Copy link
Contributor

@lionelfleury 2.0.0 has been released with a fix for this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants