@@ -387,6 +387,33 @@ pushd ${ARTIFACTS_DIR}
387
387
cp -pr * /
388
388
popd
389
389
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
+
390
417
# Construct the settings in use by galleon at provisioning and startup.
391
418
cp $HOME /.m2/settings.xml " $GALLEON_MAVEN_SETTINGS_XML "
392
419
local_repo_xml=" \n\
@@ -1031,6 +1058,11 @@ fi
1031
1058
1032
1059
rm -rf $TMP_GALLEON_LOCAL_MAVEN_REPO
1033
1060
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
+
1034
1066
if [ ! -d $SERVER_DIR ]; then
1035
1067
echo " Error, no server provisioned in $SERVER_DIR "
1036
1068
exit 1
0 commit comments