1

my questions is, has anyone come across something like e.g switching JS lib between aem60 and aem63. What I mean is, e.g: in AEM6.0 instance, my component will use Parsleyjs version 2.2.0, now because we are slowly upgrading each instance to AEM6.3, and we use one single code base repo for all instances, so we need ability when AEM6.3 instance is running, component will have the ability to auto switch to Parsleyjs version 2.8.1

My current thinking is, under etc/clientlib/myproject/liberies, i have two versions of parsleyjs with two different categories. please see screenshot: enter image description here

so parsleyjs 2-2 and 2-8.

Then in my etc/clientlib/myproject/components/search-box, here it lays the JS CSS code for this component, and I wish to do something like screenshot below for switching parsleyjs version for different AEM version platform. enter image description here

Any suggestions or better appoach? Please provide example answers with code or screenshot Thanks for help.

sefirosu
  • 2,558
  • 7
  • 44
  • 69

1 Answers1

0

AEM clientlibs have no way to do this OOTB.

DISCLAIMER: the solution I am about to describe will unnecessarily complicate your build.. You might be better off making the changes manually and deploy since this is a temporary thing. Additionally, this is not a complete fix. it's an approach you can follow to get the results you want.

Find a maven plugin that will do string replacement at build time.

Essentially you'd have an expression in your clientlib xml, something like:

.
. 
dependencies="${parsleyClientlib}"
.
.

then you'd pass a flag to your maven build like -Paem.version=6.3, and based on that flag, the maven plugin would replace ${parsleyClientlib} with the intended dependency name.

Possible plugins to try:

Hope this helps.

Community
  • 1
  • 1
Ahmed Musallam
  • 9,523
  • 4
  • 27
  • 47