Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!

Cloud manager password protected maven build not working

Avatar

Level 2

Currently we are integrating the 3rd part integration for which we need to download the dependency from the password protected url. And added password in the cloud manager pipeline variable but still I am getting the 401. Can you help if there is any other configuration we need to do.

 

Thanks in advance !!!

8 Replies

Avatar

Community Advisor

Hi @pratikshah 

Could you please share sample settings.xml file?



Arun Patidar

Avatar

Level 2


<server>
<id>third-party</id>
<username>${env.USERNAME}</username>
<password>${env.PASSWORD}</password>
</server>

Avatar

Level 7

1. Place settings.xml: Ensure settings.xml is in the .cloudmanager/maven/ directory in the root of the main repository (not in the sub-module).

2. Check Environment Variables: Verify the USERNAME and PASSWORD variables are set correctly in Cloud Manager's pipeline variables.
3. Correct settings.xml:

<servers>
  <server>
    <id>third-party</id>
    <username>${env.USERNAME}</username>
    <password>${env.PASSWORD}</password>
  </server>
</servers>

4. Verify pom.xml Repository: Ensure the repository URL is correctly specified in pom.xml:

<repositories>
  <repository>
    <id>third-party</id>
    <url>https://your-secure-repo.com</url>
  </repository>
</repositories>

5. Test Locally: Run the build locally to confirm the credentials work. Make sure the settings file is accessible and correctly configured in the pipeline. 

Avatar

Level 2

This configs are already in place but still it is saying 401.

status code:
401, reason phrase: Unauthorized (401) -> [Help 1]

Avatar

Level 7

Hi @pratikshah ,

If you are using git submodules then the settings.xml should be added under your parent project .cloudmanger/maven/settings.xml 

 

ex:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>third-party</id>
<username>Username</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>

Make sure you add this variable in your pipeline https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/usi... 

 

in your parent pom.xml of your respective submodule add the respostories

<repositories>
	    <repository>
		    <id>third-party</id> //same Id as mentioned in the settings.xml
		    <name>third-party</name>
		    <url>https://your.respository.url/</url>
	    <releases>
	    	<enabled>true</enabled>
	    </releases>
	    <snapshots>
	    	<enabled>false</enabled>
	    </snapshots>
	    </repository>
	</repositories>

Avatar

Level 2

Hi @arunpatidar we are using sub module approach to build in cloud manager so do we need to include(.cloudmanager/maven/settings.xml) in the main repo outside that module as well ?

Avatar

Community Advisor

Hi @pratikshah 

You can include settings.xml with all the settings, without duplicating in the POM

 

example pom, which we used in our project

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
    <profiles>
        <profile>
            <id>deploy</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>repo-1</id>
                    <name>snapshot-repository</name>
                    <url>https://repo.my.com/artifactory/repo</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>repo-2</id>
                    <name>release-repository</name>
                    <url>https://repo.my.com/artifactory/releases</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>maven-central</id>
                    <url>https://repo.my.com/artifactory/maven-repo</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>apache-releases</id>
                    <url>https://repo.my.com/artifactory/apache-releases</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
     <servers>
        <server>
            <id>repo-1</id>
            <username>${env.USER}</username>
            <password>${env.PASSWORD}</password>
        </server>
        <server>
            <id>repo-2</id>
            <username>${env.USER}</username>
            <password>${env.PASSWORD}</password>
        </server>
    </servers>
</settings>


Arun Patidar

Avatar

Administrator

@pratikshah Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!



Kautuk Sahni