Added Bootstrap but running "mvn clean install PautoInstallBundle" in ui.frontend resets my clientlibs in/apps. | Community
Skip to main content
sesmic
Level 4
Aug 8, 2022 5:55 PM UTC
Solved

Added Bootstrap but running "mvn clean install PautoInstallBundle" in ui.frontend resets my clientlibs in/apps.

Actually, I needed to add/include Bootstrap 5 in my project referring this post. And worked.

Solved: How to enable/add Bootstrap version 5 in my projec... - Adobe Experience League Community - 409989

But whenever I am running "mvn clean install -PautoInstallBundle" in ui.frontend after creating .scss for my component, my clientlibs in /apps get reset & bootstrap support is gone. So, then again I've to add bootstrap files in clientlib.
I am still learning, so I know I'm doing something wrong here. Thus, please tell me how to add bootstrap in my project.
Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Aditya_Chabuku
Aditya_ChabukuAccepted solution
New Participant
Aug 9, 2022 8:40 PM UTC

Hi @sesmic , you need to add bootstrap5 as a category name, follow this article if it helps

 https://medium.com/adobetech/creating-a-bootstrap-carousel-from-core-components-8df7b2173d25 

 

 

~Aditya.Ch

Thanks,Aditya Chabuku

4 replies

Sachin_Arora_
New Participant
Aug 9, 2022 5:40 AM UTC

Whenever you will build ui.frontend, it will overwrite the clientlib-site and clientlib-dependency. If you are adding bootstrap as a separate library then you can update clientlib-dependency with category of bootstrap 5 clientlibs.

You can refer code of ui.frontend/clientlibs.config.js, it is creating clientlibs inside ui.apps. Refer sample code for addition of bootstrap5

 

name: 'clientlib-dependencies',
categories: ['project.dependencies'],
dependencies: ['bootstrap5'],

Add bootstap5 JS and CSS file in separate clientlibs in ui.apps/project/clientlibs/bootstrap5.

 

Also this command is to install bundle of project : mvn clean install -PautoInstallBundle

Refer this document for correct commands : https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/client-side-libraries.html?lang=en

 

Translate
sesmic
sesmicAuthor
Level 4
Aug 9, 2022 5:21 PM UTC

Thanks for the reply.
I did as you said & bootstrap js & css were also added to clientlibs. But bootstrap isn't working. To add "dependencies: ['bootstrap']" don't we need to add categories = bootstrap5 to that folder?

Translate
Aditya_Chabuku
Aditya_ChabukuAccepted solution
New Participant
Aug 9, 2022 8:40 PM UTC

Hi @sesmic , you need to add bootstrap5 as a category name, follow this article if it helps

 https://medium.com/adobetech/creating-a-bootstrap-carousel-from-core-components-8df7b2173d25 

 

 

~Aditya.Ch

Translate
Thanks,Aditya Chabuku