I am trying to use @ContextAwareConfiguration to inject CA config into Sling models. This annotation is not resolved even after adding the dependency in my core pom.xml
<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.caconfig</artifactId> <version>1.0.2</version> </dependency>
It would be helpful if someone could share the correct dependency details
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @narendiran_ravi ,
As per doc https://sling.apache.org/documentation/bundles/models.html
It is available from 1.0.0 and I am able to resolve in both
can you explicitly import in your code
import org.apache.sling.models.caconfig.annotations.ContextAwareConfiguration;
Thanks
Views
Replies
Total Likes
Thanks @MukeshYadav_ for the reply. I tried to add the import directly in the model file but it is not resolved. I am not sure what I am missing.
Under which pom.xml file you have included the dependency and what is the dependency you have added? Could you please share your pom.xml if possible?
Views
Replies
Total Likes
myproj.core:1.0.0-SNAPSHOT is importing package(s) org.apache.sling.models.caconfig.annotations in start level 20 but no bundle is exporting these for that start level. (com.test:myproj.all:1.0.0-SNAPSHOT) - Compilation issue is resolved in core module, but getting this error in all module
Views
Replies
Total Likes
Hi @narendiran_ravi ,
If you want to avoid these issue we can use Context Aware config in another way as well.
You may have a look https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/in-context-aware-configura...
https://www.oshyn.com/blog/context-aware-configurations-aem
Thanks
Views
Replies
Total Likes
This method we are already using I am trying to use annotation based injection
After embedding the dependency in all pom it is working. This bundle is not provided by AEM SDK. So we need to explicitly embed in all pom so that it will be included in the build.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies