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
[CLOUD-2911] maven settings script improvements #303
Conversation
jboss/container/maven/default/bash/artifacts/opt/jboss/container/maven/default/maven-repos.sh
Outdated
Show resolved
Hide resolved
Dismissing review and asking for a new one. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
local var_name=$prefix"_"$2 | ||
echo ${!var_name:-$3} | ||
fi | ||
} | ||
# insert settings for mirrors/repository managers into settings.xml if supplied | ||
# internal function, use process_maven_settings_xml which applies all configuration | ||
function add_maven_mirrors() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest:
instead of 205-207:
local mirror_id=$(_maven_find_env "${maven_mirror_prefix}_MAVEN_MIRROR_ID" "mirror${counter}")
local mirror_url=$(_maven_find_env "${maven_mirror_prefix}_MAVEN_MIRROR_URL")
local mirror_of=$(_maven_find_env "${maven_mirror_prefix}_MAVEN_MIRROR_OF" "external:*")
to use _maven_find_prefixed_env:
local mirror_id=$(_maven_find_prefixed_env "${maven_mirror_prefix}" "MAVEN_MIRROR_ID" "mirror${counter}")
local mirror_url=$(_maven_find_prefixed_env "${maven_mirror_prefix}" "MAVEN_MIRROR_URL")
local mirror_of=$(_maven_find_prefixed_env "${maven_mirror_prefix}" "MAVEN_MIRROR_OF" "external:*")
because it can not read raw prefix here e.g. dev-one_MAVEN_MIRROR_URL even if this env exist. But it can read DEV_ONE_MAVEN_MIRROR_URL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, but this was part of the original maven.sh code. It was not part of what I introduced. So whereas I think this could be an improvement, it shouldn't hold back this PR from getting processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If user tries to use MAVEN_REPOS "dev-one,qe-two" than it is not possible to load MAVEN_MIRROR_URL .. I just copied all "examples" and did not get too far :) .. I agree and will proceed without this, it is not show-stopper and I will create ticket for this.
Merging this PR since jboss-openshift/cct_module#303 was merged, and this has to go along with it.
[CLOUD-2911] maven repository settings improvements
https://issues.jboss.org/browse/CLOUD-2911
Signed-off-by: David Ward dward@redhat.com
Thanks for submitting your Pull Request!
Please make sure your PR meets following requirements:
[CLOUD-XYA] Subject
CONTRIBUTING.md
)Signed-off-by: Your Name <yourname@redhat.com>
- usegit commit -s