AEM - Bundles not resolving with Archetype archetypeVersion=35 | org.apache.sling.api.request,version=[2.6,3) -- Cannot be resolved
#AEMGyaan time 😊 Just a quick one, in case you are also facing the same issue. I was recently trying to create a new project
org.apache.sling.api.request,version=[2.6,3) -- Cannot be resolved
Root Cause
When your new project is built using the archetype 35 for Cloud, every dependency is downloaded for the aem.sdk.api version mentioned in your pom.xml
So as per this version of cloud , the org.apache.sling.api.request,version is [2.6,3). But if the local cloud version you are using is lesser than the above version, then your bundles will not resolve and will throw the above error. So how can you resolve this 🤔🤔
Solution
2. Copy the version and paste it into your pom.xml
3. This is not the end, but let's build and check. 😉.
Recommended by LinkedIn
Oopsie... The build failed 🤔🤔🙄
So the problem here is the number after the hyphen (-). So every version has a different number after this hyphen which is specific for the jars related to these versions. Now how do you find this number for your cloud version 🤔🤔 !?
Who else to ask for... GOOGLE 😁😁
If you are lucky, Google will tell you the last 6 digits you need for this version. (Sorry guys, I don't know if we have any other way to find it. 😑😑. )
Replace this number and build your project
4. Install the package
Now your bundle should be active and with the right version for your current cloud version of AEM
Hope this helps. As usual, keep rocking and keep learning
Senior AEM Developer
9moThanks for the post. Your solution was exactly what I needed.
Technical Architect at Adobe
9moWorked like a charm!
Sr SoftwareEngineer
1yThe AEM cloud project is being downgraded to AEM 6.5. Certain dependencies still need to be addressed. Kindly help me on this Regards, Jhansi
Senior Developer - AEM | Java | Microservices
1yThank you Veena Vikraman. I had the same issue with archetype 40 & 41 for cloud version, and I followed the same steps as you have mentioned, but I think I found another way to find the exact version. 1. Copy & paste the aem.sdk version in Google. 2. Go for the result which has a link to the maven central repo. 3. find the entry in the list of entries in maven repo 4. It has a six digit number after the dash - I added the same to my pom.xml and it fixed the issue. Hope this helps!
Ex-Adobe . AEM 6.2(on premises) • AEM 6.5(cloud | on premises) • Dispatcher Configurations. Java • Spring Boot • Micro services • REST API • SOAP • SAP Integration • E-comerce • Git • Project Management • Jira
2yWhat about the same issue in on premises?