Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

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

Avatar

Employee
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
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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


Aanchal Sikka

View solution in original post

7 Replies

Avatar

Community Advisor

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

Avatar

Employee

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

Avatar

Community Advisor

@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

Avatar

Employee

@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.

Avatar

Correct answer by
Community Advisor

@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


Aanchal Sikka

Avatar

Administrator

@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

Avatar

Community Advisor

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