Expand my Community achievements bar.

SOLVED

maven dependency--> org.apache.sling.model

Avatar

Level 7

amitsample - Corecom.amit.sample.core secreenshot

1832374_pastedImage_0.png

maven dependency I added

<!-- https://mvnrepository.com/artifact/org.apache.sling/org.apache.sling.models.api -->
<dependency>
  <groupId>org.apache.sling</groupId>
  <artifactId>org.apache.sling.models.api</artifactId>
  <version>1.2.2</version>
  <scope>provided</scope>
</dependency>

but after doing maven clean install and uploading the bundle in aem I am getting like above ---> can not be resolved ...

and even when i check sling model api bundle in my system/console it is showing lower version 1.1.0

why it has not been updated when i updated my maven dependncy version and built(amitsample - Corecom.amit.sample.core) it and uploaded in system/console ..

if I want to use 1.2.2 version of sling model api how we can do that ? ---adding maven dependcy is not helping ...

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The only recommended way is to upgrade to the latest version of AEM. Installing a bundle that is meant to be for a higher version of AEM on a lower version is not a good idea. It might work but thats not a recommended way of doing things in AEM.

If you install the latest sling model bundle on AEM 6.0 from system/console, it will not resolve as it imports/exports packages based on the AEM version and not the individual bundle.

Every bundle in AEM has an export/import list which needs to be satisfied before a bundle can be resolved and Bundles are build keeping in mind the dependecies(Export/Import) for a particular version of AEM.

View solution in original post

5 Replies

Avatar

Employee Advisor

You need to use the version of AEM that provides sling model API 1.2.2 OOTB. Example: AEM 6.3.3.5 has sling model API version 1.3.8

Screen Shot 2019-09-12 at 7.14.51 AM.png

Avatar

Level 7

Hey jaideep,

Thanks for the reply.... That is wat I am asking... I have to switch to higher version of aem like 6.3 or upper version to use these annotation.. If I want to use with lower version of aem like 6.0 is there any way?

Like specifically insatllimg bundle explicity in aem in system/console..... In aem 6.3 higher version we will get thses feature inbuit like sling model and sling exporter and all.. If I use these all features with lower version of aem.. There would be comaptibilty issue...?

Avatar

Correct answer by
Employee Advisor

The only recommended way is to upgrade to the latest version of AEM. Installing a bundle that is meant to be for a higher version of AEM on a lower version is not a good idea. It might work but thats not a recommended way of doing things in AEM.

If you install the latest sling model bundle on AEM 6.0 from system/console, it will not resolve as it imports/exports packages based on the AEM version and not the individual bundle.

Every bundle in AEM has an export/import list which needs to be satisfied before a bundle can be resolved and Bundles are build keeping in mind the dependecies(Export/Import) for a particular version of AEM.