deploying .cloudmanager/maven/settings.xml without secret pipeline variable | Community
Skip to main content
January 24, 2024
Solved

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

  • January 24, 2024
  • 2 replies
  • 1649 views

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 

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 Rohan_Garg

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.

2 replies

arunpatidar
Community Advisor
Community Advisor
January 24, 2024

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
aem_noobAuthor
January 25, 2024

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

Rohan_Garg
Community Advisor
Rohan_GargCommunity AdvisorAccepted solution
Community Advisor
January 24, 2024

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.
aem_noobAuthor
January 25, 2024

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?