Skip to content

Commit 9735ed4

Browse files
Jan Lieskovskypskopek
authored andcommitted
[CIAM-1269] [SSOSUP-84] When starting the RH-SSO container, try to load the
required boot dependencies from the local Galleon repository first to benefit from already downloaded artifacts Signed-off-by: Jan Lieskovsky <[email protected]>
1 parent 760939b commit 9735ed4

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

modules/eap/setup/eap/modules/artifacts/opt/jboss/container/maven/default/jboss-settings.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,16 @@
277277

278278
</profiles>
279279
<activeProfiles>
280-
<activeProfile>securecentral</activeProfile>
281-
<!-- Start of RH-SSO add-on:
282-
=======================
283-
Explicitly activate the 'jboss-eap-repository' since at the very least the 'earlyaccess' repo is
284-
required for the 'org.aesh:aesh-extensions:1.8.0.redhat-00001' artifact to be resolved properly.
280+
<!-- CIAM-535 / KEYCLOAK-18574 correction
281+
~
282+
~ Explicitly activate the 'jboss-eap-repository' since at the very least
283+
~ the 'earlyaccess' repo is required to download the Galleon dependencies
284+
~ in the case these dependencies weren't published to external 3rd party
285+
~ Maven repositories yet
285286
-->
286287
<activeProfile>jboss-eap-repository</activeProfile>
287-
<!-- End of RH-SSO add-on -->
288+
<!-- EOF CIAM-535 / KEYCLOAK-18574 correction -->
289+
<activeProfile>securecentral</activeProfile>
288290
<!-- ### active profiles ### -->
289291
</activeProfiles>
290292
</settings>

modules/eap/setup/eap/modules/configure.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,33 @@ pushd ${ARTIFACTS_DIR}
387387
cp -pr * /
388388
popd
389389

390+
# CIAM-1269 / SSOSUP-84 correction
391+
#
392+
# Since there can be only one <localRepository> element in the currently used
393+
# Maven settings.xml file, if the user requested custom Maven local repository
394+
# location via optional MAVEN_REPO_LOCAL or MAVEN_LOCAL_REPO image environment
395+
# variables, use that directory location for Galleon local repository too.
396+
# Otherwise set it to the default GALLEON_LOCAL_MAVEN_REPO environment variable
397+
# value, which is always set
398+
#
399+
GALLEON_LOCAL_MAVEN_REPO="${MAVEN_LOCAL_REPO:-${MAVEN_REPO_LOCAL:-${GALLEON_LOCAL_MAVEN_REPO}}}"
400+
local_repo_xml="\n\
401+
<localRepository>${GALLEON_LOCAL_MAVEN_REPO}</localRepository>"
402+
403+
# Similarly, if the user requested custom location of the user settings.xml
404+
# file via optional MAVEN_SETTINGS_XML image environment variable, use that
405+
# location instead of the default "${HOME}/.m2/settings.xml" one
406+
settings_xml="${MAVEN_SETTINGS_XML:-${HOME}/.m2/settings.xml}"
407+
408+
# Finally set the <localRepository> element in settings.xml to point to chosen
409+
# directory to:
410+
# 1) Prevent needed artifact downloads by each container startup in online mode
411+
# 2) Make the previously downloaded artifacts available at container startup in
412+
# offline mode too
413+
#
414+
sed -i "s|<!-- ### configured local repository ### -->|${local_repo_xml}|" "${settings_xml}"
415+
# EOF CIAM-1269 / SSOSUP-84 correction
416+
390417
# Construct the settings in use by galleon at provisioning and startup.
391418
cp $HOME/.m2/settings.xml "$GALLEON_MAVEN_SETTINGS_XML"
392419
local_repo_xml="\n\
@@ -1031,6 +1058,11 @@ fi
10311058

10321059
rm -rf $TMP_GALLEON_LOCAL_MAVEN_REPO
10331060

1061+
# CIAM-1269 / SSOSUP-84 correction
1062+
# Make the 'jboss' user owner of the artifacts present in the local Galleon repository
1063+
chown -R jboss:root "${GALLEON_LOCAL_MAVEN_REPO}"
1064+
# EOF CIAM-1269 / SSOSUP-84 correction
1065+
10341066
if [ ! -d $SERVER_DIR ]; then
10351067
echo "Error, no server provisioned in $SERVER_DIR"
10361068
exit 1

0 commit comments

Comments
 (0)