Server details on parent repo or submodule repo when external dependency is added on submodules | Community
Skip to main content
Adobe Employee
December 4, 2023
Solved

Server details on parent repo or submodule repo when external dependency is added on submodules

  • December 4, 2023
  • 3 replies
  • 1247 views
Hello ,
 
In AEMaaCS, We are using submodules in our project repo. In Submodule repo ,some external dependency been added. for that they have added server username and password in cloudmanager/maven/settings.xml folder in submodule repo. While building our code in cloud, we are getting this error "
  • Maven was not able to download necessary dependencies due to an access issue. Please check any provided credentials and confirm they are valid. More details may be found in the log." . Note: I have added the password in pipeline variable. still its giving this error
Do we need to create cloudmanager/maven/settings.xml folder in our main project apart from submodule and add server details as well? Then only cloud can recognize the server and download dependency? My understanding that it can download the dependency as server details are present in submodules and dependency is added in submodule only. please confirm how to proceed. its working in my local when I add server details to m2/settings.xml file
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

@aanchal-sikka 

Actually we don't have write access to submodule we use. we can only include it in our repo. So .cloudmanager/maven/settings.xml will always be there in submodule.


@amsalek4 

 

Skip the profile part and try with ".cloudmanager/maven/settings.xml" in parent.

It should be ok to have it in sub-module as well

3 replies

aanchal-sikka
Community Advisor
Community Advisor
December 5, 2023

Hello @amsalek4 

 

The maven repository details should be kept in .cloudmanager/maven/settings.xml of parent project.

 

You should also raise an Adobe ticket, if you have any specific usecase due to which it needs to be module specific.

Aanchal Sikka
Amsalek4Adobe EmployeeAuthor
Adobe Employee
December 5, 2023

Thanks @aanchal-sikka .

 

May I know can we keep  .cloudmanager/maven/settings.xml in parent as well as submodule. As submodule repo is being used separately for other teams, we need that in submodule as well. would that be recommended if we keep it in both places

Amsalek4Adobe EmployeeAuthor
Adobe Employee
December 5, 2023

@amsalek4 

 

  • Place ".cloudmanager/maven/settings.xml" in parent only, because its used by CM
  • In sub-modules, create a new profile. This profile will be disabled on cloud because of env variable env.CM_BUILD
<profiles> <profile> <id>artifactory</id> <activation> <property> <name>!env.CM_BUILD</name> </property> <repositories> <repository> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> <id>snapshots</id> <name>name-of-repo</name> <url>url-of-repo</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <snapshots/> <id>snapshots</id> <name>name-of-plugin-repo</name> <url>url-of-plugin-repo</url> </pluginRepository> </pluginRepositories> </profile> </profiles>

@aanchal-sikka 

Actually we don't have write access to submodule we use. we can only include it in our repo. So .cloudmanager/maven/settings.xml will always be there in submodule.

kautuk_sahni
Community Manager
Community Manager
December 5, 2023

@amsalek4 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
arunpatidar
Community Advisor
Community Advisor
December 5, 2023

Hi @amsalek4 
Use pipeline variables to add server details at parent level .cloudmanager/maven/settings.xml.

It will work at submodules level as well but always add at one place(parent)

Arun Patidar