Skip to content

Commit 625641f

Browse files
authored
Merge pull request #361 from jmtd/OPENJDK-1961-MAVEN_REPO_URL
Openjdk 1961, 1964: tests and docs for MAVEN_REPO_URL, MAVEN_REPOS, etc.
2 parents 484dbbe + 8906496 commit 625641f

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

modules/maven/default/module.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ envs:
5050
- name: MAVEN_LOCAL_REPO
5151
description: Directory to use as the local Maven repository.
5252
example: /home/default/.m2/repository
53+
- name: "MAVEN_REPO_URL"
54+
example: "http://repo.example.com:8080/maven2/"
55+
description: >
56+
Specify a Maven repository by URL.
57+
See MAVEN_REPOS for specifying multiple repositories.
58+
- name: "MAVEN_REPO_ID"
59+
example: "myrepo"
60+
description: >
61+
Provide a static ID for the Maven repository specified by
62+
MAVEN_REPO_URL. The default is to generate a random ID.
63+
See MAVEN_REPOS for specifying multiple repositories.
5364
- name: "MAVEN_REPOS"
5465
example: "dev-one,qe-two"
5566
description: "If set, multi-repo support is enabled, and other MAVEN_REPO_* variables will be prefixed. For example: DEV_ONE_MAVEN_REPO_URL and QE_TWO_MAVEN_REPO_URL"

tests/features/java/java_s2i.feature

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,32 @@ Feature: Openshift OpenJDK S2I tests
137137
Given s2i build https://github.com/jboss-openshift/openshift-examples from spring-boot-sample-simple/target
138138
Then s2i build log should not contain skipping directory .
139139
And run find /deployments in container and check its output for spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar
140+
141+
# OPENJDK-1954 - MAVEN_REPOS
142+
Scenario: run the s2i and check the maven mirror and proxy have been initialised in the default settings.xml, uses http_proxy
143+
Given s2i build https://github.com/jboss-openshift/openshift-examples from spring-boot-sample-simple/target
144+
| variable | value |
145+
| MAVEN_REPOS | TESTREPO,ANOTHER |
146+
| TESTREPO_MAVEN_REPO_URL | http://repo.example.com:8080/maven2/ |
147+
| TESTREPO_MAVEN_REPO_ID | myrepo |
148+
| ANOTHER_MAVEN_REPO_URL | https://repo.example.org:8888/ |
149+
| ANOTHER_MAVEN_REPO_ID | another |
150+
And XML namespaces
151+
| prefix | url |
152+
| ns | http://maven.apache.org/SETTINGS/1.0.0 |
153+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:server[ns:id='myrepo']
154+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:profile[ns:id='myrepo-profile']/ns:repositories/ns:repository[ns:url='http://repo.example.com:8080/maven2/']
155+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:server[ns:id='another']
156+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:profile[ns:id='another-profile']/ns:repositories/ns:repository[ns:url='https://repo.example.org:8888/']
157+
158+
# OPENJDK-1961: MAVEN_REPO_URL and MAVEN_REPO_ID
159+
Scenario: Check MAVEN_REPO_URL generates Maven settings and profile configuration
160+
Given s2i build https://github.com/jboss-openshift/openshift-examples from spring-boot-sample-simple/target
161+
| variable | value |
162+
| MAVEN_REPO_URL | http://repo.example.com:8080/maven2/ |
163+
| MAVEN_REPO_ID | myrepo |
164+
And XML namespaces
165+
| prefix | url |
166+
| ns | http://maven.apache.org/SETTINGS/1.0.0 |
167+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:server[ns:id='myrepo']
168+
Then XML file /tmp/artifacts/configuration/settings.xml should have 1 elements on XPath //ns:profile[ns:id='myrepo-profile']/ns:repositories/ns:repository[ns:url='http://repo.example.com:8080/maven2/']

0 commit comments

Comments
 (0)