I created one maven project with aem-project-archetype
version 13.
After installing the bundle to AEM, I am getting error in felix
console that 3 of the imported bundles could not be resolved
.
I am trying to find out that from where these are being included into my manifest file which is inside the target/MANIFEST folder.
so that i could modify the versions of the respective bundles.
the error i am geting in felix console, my bundle is in installed state, not active
org.apache.sling.api.resource,version=[2.10,3) -- Cannot be resolved
org.apache.sling.api.servlets,version=[2.2,3) -- Cannot be resolved
org.apache.sling.models.annotations,version=[1.4,2) -- Cannot be resolved
When you're developing AEM applications, the OSGI bundle (and Manifest) is typically generated via the Felix maven-bundle-plugin.
The plugin writes your package imports
based on the java packages you import in your all of your Java code. If you are importing from a maven dependency, say Sling
the version for that import will be the package version from Sling
.
The issue you are having here could be one of two
2.
is likely the case because sling is always bundled with AEM.
What can you do to debug/fix?
pom.xml
and make sure the OSGI version is within the range specified by the
manifest imports. You can use maven dependency tree to list all
your dependencies and their versions.uber-jar
make sure you are
using the correct version for the correct AEM instance you're
running.Note that in manifest imports the range
[2.10,3)
means it accepts all versions between 2.10.0 and 3.0.0 but NOT including 3.0.0. In my experience, Maven bundle plugin will always write the range where the min is your maven dependency package version and the max is the nextmajor
version.
Changing the imports manually:
This is not recommended and has very specific use cases, but you could manually tell the bundle plugin what version to add to the imports. See import-package instruction in the bundle plugin docs