cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 app requesting for custom reuse library from SAPUI5 CDN rather than CloudFoundry env

junweitoh
Associate
Associate
0 Kudos

I have 2 SAPUI5 applications that are deployed on CloudFoundry with a FLP. I have created a custom reuse library to support these 2 applications (the library + applications are under the same repo). I built my repo using MTA and have pushed it to CF. When opening the app, the app tries to fetch the library from https://sapui5.hana.ondemand.com/1.120.5/resources/sap/my/library/name/library-preload.js instead of https://my.flp.domain/sapmylibraryname/~020224121929+0000~/library-preload.js. I am not sure how to get my apps to resolve the library's url properly.

My library's id in manifest.json is sap.my.project.lib (as an example) and my apps' manifest.json have correctly declared the library under dependencies as well:

"dependencies": {
      "minUI5Version": "1.120.0",
      "libs": {
        "sap.m": {},
        "sap.ui.core": {},
        "sap.f": {},
        "sap.ui.comp": {},
        "sap.my.project.lib": {}
      }
    },

This is my mta.yaml file:

---
ID: com.sap.my.project.ui.h5repo
_schema-version: '3.1'
parameters:
  deploy_mode: html5-repo
version: 1.0.0
modules:
- name: my-project-ui-deployer
  path: uideployer
  type: com.sap.html5.application.content
  properties:
    EXIT_PROCESS_AFTER_UPLOAD: true
  requires:
  - name: project-ui-repo
  build-parameters:
    requires:
    - name: my-project-app-one
      artifacts:
      - "./*"
      target-path: resources/my-project-app-one
    - name: my-project-app-twp
      artifacts:
      - "./*"
      target-path: resources/my-project-app-twp
    - name: my-project-lib
      artifacts:
      - './resources/sap/my/project/lib/*'
      target-path: resources/my-project-lib
- name: my-project-app-one
  type: html5
  path: project-app-one
  build-parameters:
    supported-platforms: []
    builder: custom
    commands:
      - npm install -g yarn
      - yarn install
      - yarn run build
      - cp xs-app.json dist/xs-app.json
    build-result: dist
- name: my-project-app-two
  type: html5
  path: project-app-two
  build-parameters:
    supported-platforms: []
    builder: custom
    commands:
      - npm install -g yarn
      - yarn install
      - yarn run build
      - cp xs-app.json dist/xs-app.json
    build-result: dist
- name: my-project-lib
  type: html5
  path: lib
  build-parameters:
    supported-platforms: []
    builder: custom
    commands:
      - npm install -g yarn
      - yarn install
      - yarn run build
      - cp xs-app.json dist/resources/sap/my/project/lib/xs-app.json
      - cp src/sap/my/project/lib/manifest.json dist/resources/sap/my/project/lib/manifest.json
    build-result: dist
resources:
- name: project-ui-repo
  type: org.cloudfoundry.existing-service

The uideployer folder looks like this:

uideployer\
|- resources\
    |-- my-project-app-one\
    |-- my-project-app-two\
    |-- my-project-lib\
        |-- controllers\
        |-- utils\
        |-- library.js
        |-- manifest.json
        |-- xs-app.json  

 

Accepted Solutions (0)

Answers (1)

Answers (1)

junweitoh
Associate
Associate
0 Kudos

Update: the issue seemed to have resolve by itself. Perhaps it was a server-side cache issue with the FLP