Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

deploying .cloudmanager/maven/settings.xml without secret pipeline variable

Avatar

Level 4

hi folks,

 

i want to know if it is possible to deploy <server> configuration in maven such as id username and pwd using settings.xml defined in our repo at path /.cloudmanager/maven/settings.xml

we want to make the artifacts available to anyone from the remote server without explicitly defining the secret pipeline variable which can then be read by settings.xml defined in the repo.

 

i am currently defining the below configuration in local settings.xml but want to move it to the cloud repo.

defining a secret pipeline variable will restrict us to first set the env variable in cloud env and then deploy - can't the deployment make sure the below config from settings.xml is merged with the default settings.xml provided by cloud manager??

<server>
<id>test-remote-server</id>
<username>username</username>
<password>password</password>
</server>

let me know if the use case makes sense.
reference url - pwd protected maven repos

 

@EstebanBustamante@Rohan_Garg@arunpatidar@aanchal-sikka 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I agree setting up pipeline variable is the best and the recommended way to use password protected maven repo within cloud manager.
However, if you are simply looking for reading custom settings.xml defined in your custom codebase you can look at the build profile and maven build command.

mvn -s C:\settings.xml -gs C:\settings.xml clean install
This allows you to point the settings.xml to a particular path. You can replace C:\ with ./cloudmanager/maven/settings.xml to pick up the particular configuration.

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @aem_noob 
I think setting up a pipeline variable as a correct way to go if you are using restricted artifactor repository.

You need to set pipeline variable just once.

 

you can use cloud manager API to set variable in advance using just one click

https://developer.adobe.com/experience-cloud/cloud-manager/reference/api/#tag/Variables 



Arun Patidar

Avatar

Level 4

for any 3rd party dependency download in our own project we generally don't set pipeline variable.

i want to first upload my artifacts to a remote repo and then have them download as dependency such as we do with acs commons

Avatar

Correct answer by
Community Advisor

I agree setting up pipeline variable is the best and the recommended way to use password protected maven repo within cloud manager.
However, if you are simply looking for reading custom settings.xml defined in your custom codebase you can look at the build profile and maven build command.

mvn -s C:\settings.xml -gs C:\settings.xml clean install
This allows you to point the settings.xml to a particular path. You can replace C:\ with ./cloudmanager/maven/settings.xml to pick up the particular configuration.

Avatar

Level 4

this works! but what is the drawback of using this vs pipeline variable?
If my remote repo contains artifact that are required to be download w/o any action from a user then isn't it better to allow download as part of repo defined settings.xml?