Settings.xml for maven build in GitLab


i have a maven project in gitlab, where should i keep the settings.xml file, i tried to keep it in $Home/.m2/ directory, but its not working, builds in gitlab are failing as its not able to read the file from .m2

if i add the settings.xml file in gitlab directly under the project - it works,

i have nearly 100 projects in gitlab- do i need to add under all the projects in gitlab just like …gitlab-ci.yml,

please suggest