My OSGI bundle will not start if I use the AEM wcm core components (to be specific the Image component) in my java code:
package be.ovl.aem.services.models.components.content.enhancedimage.impl;
import be.ovl.aem.services.models.components.content.enhancedimage.EnhancedImage;
**import com.adobe.cq.wcm.core.components.models.Image;**
import lombok.Data;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Via;
import org.apache.sling.models.annotations.injectorspecific.Self;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
import org.apache.sling.models.annotations.via.ResourceSuperType;
@Data
@Model(
adaptables = Resource.class,
adapters = EnhancedImage.class,
resourceType = "ovl/components/content/enhanced-image"
)
public class EnhancedImageImpl implements EnhancedImage {
@ValueMapValue
String imageText;
@ValueMapValue
String imageCopyright;
@Self
@Via(type = ResourceSuperType.class)
private Image image;
public String getImageText() {
return imageText;
}
public void setImageText(String imageText) {
this.imageText = imageText;
}
public String getImageCopyright() {
return imageCopyright;
}
public void setImageCopyright(String imageCopyright) {
this.imageCopyright = imageCopyright;
}
public Image getImage() {
return image;
}
public void setImage(Image image) {
this.image = image;
}
}
In the Adobe Experience Manager Web Console Bundles, I see this:
=> com.adobe.cq.wcm.core.components.models,version=[11.1,12) -- Cannot be resolved
I'm using Adobe Experience Manager (AEM) 6.3.1.
If I change the uber-jar version in the POM from 6.3.1 to 6.3.1.2, then it resolves but I get another unresolved depandency in my bundle. The POM:
<!-- AEM public API -->
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.3.1.2</version>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
And this is the unresolved depandency:
=> org.apache.sling.xss,version=[2.0,3) -- Cannot be resolved
It seems like the chicken and the egg problem... Can someone help me please?