AEM Cannot be resolved for some libs

Lola picture Lola · Jan 11, 2016 · Viewed 13k times · Source

Adobe CQ5, Version 5.5.0

com.day.cq.commons,version=[5.7,6) -- Cannot be resolved
com.day.cq.commons.jcr,version=[5.7,6) -- Cannot be resolved
com.day.cq.dam.api,version=[1.2,2) -- Cannot be resolved
com.day.cq.replication,version=[5.15,6) -- Cannot be resolved
com.day.cq.wcm.api,version=[1.2,2) -- Cannot be resolved
com.day.cq.wcm.api.components,version=[5.7,6) -- Cannot be resolved
com.day.cq.wcm.api.designer,version=[5.7,6) -- Cannot be resolved
org.apache.sling.api,version=[2.3,3) -- Cannot be resolved
org.apache.sling.api.resource,version=[2.5,3) -- Cannot be resolved
org.apache.sling.api.wrappers,version=[2.5,3) -- Cannot be resolved
org.apache.sling.commons.scheduler,version=[2.3,3) -- Cannot be resolved

For example:

i uses org.apache.sling.api <version>2.7.0</version> in pom.xml and see this error org.apache.sling.api,version=[2.3,3) -- Cannot be resolved -

I found simular question and if follow next answer I'm doing everything right - but I have same errors

The error message means that the OSGi framework is unable to supply a version >= 2.3 and < 3 of the org.apache.sling.api.resource Java package for a bundle B that wants to import it.

Does anyone know how to fix these errors?

Answer

Oleksandr Tarasenko picture Oleksandr Tarasenko · Jan 11, 2016

I think you use too fresh version of org.apache.sling.api. Because on CQ 5.6.1 <version>2.4.3-R1488084-B001</version> is used for this bundle.

I would suggest you to do next:

Check Sling/AEM dependencies you have in your POM file with Dependency Finder (you can find it there /system/console/depfinder). Just put there artifactId/package and it will provide you with correct Maven dependency.

For example for me it looks like this Dependency finder