cf repo onboard-app fails with The Spring commercial recipes can not be downloaded
search cancel

cf repo onboard-app fails with The Spring commercial recipes can not be downloaded

book

Article ID: 430605

calendar_today

Updated On:

Products

VMware Tanzu Platform - Hub

Issue/Introduction

Customer is performing app onboarding using cf repo onboard-app command and hitting issue of The Spring commercial recipes can not be downloaded as can be seen below.

cf repo onboard-app
Onboarding the application from /Users/test/test-demo.

🏃 [ 1 / 4 ] Resolving the last assessment(s) for repository  and branch  [00m 01s] ok
🏃 [ 2 / 4 ] Checking changes
🏃 [ 3 / 4 ] Checking the assessment results

🚧 There is 1 challenge detected. Please address it before deploying your application.
    - [java-logging-file-appender] [automatic fix]: Replace file appender with console appender

The full assessment report is in .tanzu/assessment-report.yml. Please, fix all the identified issues before proceeding with the deployment. Do you want to proceed with the onboarding and generate the manifest file? [Y/N]
y

Generating build config file to configure properly the suggested manifest:
    +--- 🏃 [ 1 / 6 ] Resolving build tool version [00m 01s] ok
    +--- 🏃 [ 2 / 6 ] Resolving dependencies with mvn [00m 02s] ok
    +--- 🏃 [ 3 / 6 ] Resolving JDK version [00m 04s] ok
    +--- 🏃 [ 4 / 6 ] Resolving Git repository [00m 01s] ok
    +--- 🏃 [ 5 / 6 ] Resolving application modules [00m 01s] ok
    +--- 🏃 [ 6 / 6 ] Obtaining dependency management artifacts [00m 03s] ok

Enter value for app.name [press Enter for 'test-demo']:
 Enter value for app.memory [press Enter for '1G']:
 Enter value for app.instances [press Enter for '1']:
 Enter comma-separated values for app.buildpacks [press Enter for 'java_buildpack_offline']:
 Enter value for app.path [press Enter for 'target/test-demo.jar']:
 Enter comma-separated environment variables for app.env (key=value) [press Enter for 'JBP_CONFIG_OPEN_JDK_JRE='{jre: {version: 11.+}}',SPRING_PROFILES_ACTIVE=default']:
 Enter value for app.healthCheckType [press Enter for 'port']:
 Enter value for app.diskQuota [press Enter for '1G']:
Generating Cloud Foundry manifest for: java at path: /Users/test/test-demo
Cloud Foundry manifest created at: /Users/test/test-demo/manifest.yml
Congratulations! You can now test this application running `cf login` with your org and `cf push` using manifest.yml
🏃 [ 4 / 4 ] Proceeding with the anti-patterns [00m 07s] error

💔 Errors
- test-demo failed with the following message:
🔎 The Spring commercial recipes can not be downloaded. Have you configured your Spring Enterprise Maven settings? Please check the docs at: https://techdocs.broadcom.com/us/en/vmware-tanzu/spring/tanzu-spring/commercial/spring-tanzu/guide-artifact-repository-administrators.html.
exit status 1
FAILED

 

User has .m2/settings.xml configured with valid creds and download URL.

Example settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>/Users/test/.m2/repository</localRepository>
  <servers>
    <server>
      <id>spring-enterprise-subscription</id>
      <username>#########</username>
      <password>#########</password>
    </server>
  </servers>
  <profiles>
    <profile>
      <id>spring-enterprise</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>spring-enterprise-subscription</id>
          <url>https://packages.broadcom.com/artifactory/tanzu-maven/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>spring-enterprise-subscription</id>
          <url>https://packages.broadcom.com/artifactory/tanzu-maven/</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>spring-enterprise</activeProfile>
  </activeProfiles>
</settings>

Environment

Tanzu Hub v10.3.5
CF CLI v10.3.9
Repo v1.0.9

Resolution

The error likely indicates a problem with user's .m2/settings.xml file.
 
Validate that the settings.xml is valid xml:
$ xmllint --verify m2/settings.xml
(above command should not report any errors)
 
Alternatively, hidden/special characters can also be checked for in settings.xml by using vim:
  1. Enter command mode by pressing Esc.
  2. Type :set list and press Enter.
  3. Vim will now display hidden characters

Ensure no unexpected hidden characters in xml and lines are properly escaped.