Bug 1331656

Summary: [DOCS] No mention of proxy settings for Maven
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: DocumentationAssignee: brice <bfallonf>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Schlosser <tschloss>
Severity: high Docs Contact: Vikram Goyal <vigoyal>
Priority: medium    
Version: 3.1.0CC: aos-bugs, bmeng, haowang, jokerman, mmccomas, tschloss
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-11 03:23:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jaspreet Kaur 2016-04-29 07:34:10 UTC
Document URL: https://access.redhat.com/documentation/en/openshift-enterprise/version-3.1/installation-and-configuration/#working-with-http-proxies

Section Number and Name: Chapter 15. Working with HTTP Proxies

Describe the issue: There is no mention of configuring proxies when maven downloads the dependencies. If no proxy is configured users will fail with below errors :

Connection to https://repo1.maven.org refused

or  

Connection to http://maven.repository.redhat.com refused: Connection timed out

Suggestions for improvement: Please provide the correct steps for maven proxy configuration in Openbshift  3

Additional information: 

A related might help - https://access.redhat.com/solutions/1758313

Comment 1 brice 2016-07-12 06:24:59 UTC
I've created a PR for this:

https://github.com/openshift/openshift-docs/pull/2491

Meng Bo, as this is a new procedure to the docs, can I ask for a QA test please? I hope there's enough information to test this out and hopefully pass. If you need more information please let me know.

Thanks!

Comment 2 Wang Haoran 2016-07-12 07:58:05 UTC
Hi, Tomas, could you please help verify this ?

Comment 3 Tomas Schlosser 2016-07-13 06:17:58 UTC
Hello,
I would recommend other possibilities then what is documented:
1) provide $HTTP_PROXY_HOST and $HTTP_PROXY_PORT environment variables in .s2i/environment or in the BuildConfig
  - this will generate the settings.xml for the user
  - optionally, you can use other environment variables $HTTP_PROXY_USERNAME $HTTP_PROXY_PASSWORD $HTTP_PROXY_NONPROXYHOSTS
  - works for all xPaaS images except FIS
2) put your custom-made settings.xml into <git>/configuration/settings.xml
  - works for all xPaaS images (including FIS)
3) put your settings

Other points:
- don't use MAVEN_ARGS env var, use MAVEN_ARGS_APPEND instead (so you don't have to add everything, just the specifics)
- using custom assemble script (as suggested in linked solution) is completely wrong approach

Comment 4 brice 2016-07-20 03:08:48 UTC
Tomas

Thanks very much for the extra information. I've updated the PR:

https://github.com/openshift/openshift-docs/pull/2491

I think step 3 you mention above might need more info, though. Did the comment get cuttoff? I'm also eager to hear any other feedback you have, or if you have any more information.

Thanks!

Comment 5 Tomas Schlosser 2016-07-25 08:14:07 UTC
Sorry, I must have hit the send button too soon.

The third option would be to put your settings.xml anywhere in the git and use MAVEN_ARGS_APPEND variable to point to it (e.g. MAVEN_ARGS_APPEND=/tmp/source/<path_within_git>).

Pull request looks good. I'd add other optional environment variables to it for completeness:
- HTTP_PROXY_PASSWORD
- HTTP_PROXY_NONPROXYHOSTS

Comment 6 brice 2016-07-26 03:49:16 UTC
Tomas,

Thanks so much for the extra info. I've updated the PR:

https://github.com/openshift/openshift-docs/pull/2491

Can I ask for an ack that everything is correct?

One thing, you mention that what was missing was "the third option". Does that mean that what you've given me are three different options, instead of three steps to a procedure, like I have written up? That's all.

Thanks again.

Comment 7 Tomas Schlosser 2016-07-26 07:10:19 UTC
Yes, these are three separate options, not steps to follow.

Value of append should contain also -s switch i.e.
MAVEN_ARGS_APPEND="-s path/to/file"

Comment 8 brice 2016-07-27 03:16:08 UTC
Tomas,

Sure. I've fixed the topic:

https://github.com/openshift/openshift-docs/pull/2491

Is there anything else you'd like to mention? If not, I can probably go ahead with this.

Thanks, again.

Comment 9 Tomas Schlosser 2016-07-27 10:51:39 UTC
Looks good to me! Thanks for doing the update!

Comment 10 brice 2016-07-28 00:23:51 UTC
Thanks, Tomas!

I'll put this onto peer review.

Comment 11 openshift-github-bot 2016-07-29 00:19:48 UTC
Commit pushed to master at https://github.com/openshift/openshift-docs

https://github.com/openshift/openshift-docs/commit/5c3943969fd3d6d3ab143580410f2135df6afd96
Merge pull request #2491 from bfallonf/bz1331656

Bug 1331656 added maven proxy section