Expand my Community achievements bar.

SOLVED

Using eclipse AEM plugin with AEM 5.6.1 have sling API version mismatch issue.

Avatar

Level 2

Hi,

When creating new project using AEM plugin ( http://eclipse.adobe.com/aem/dev-tools/) with AEM 5.6.1 sever , I am getting below error :

Publishing failed Failed installing bundle : Unable to install/update bundle from dir E:\test\ws\sample\core\target\classes : Unresolved constraint in bundle com.sample.core [309]: Unable to resolve 309.0: missing requirement [309.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api)(version>=2.3.0)(!(version>=3.0.0))) Unable to install/update bundle from dir E:\test\ws\sample\core\target\classes : Unresolved constraint in bundle com.sample.core [309]: Unable to resolve 309.0: missing requirement [309.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api)(version>=2.3.0)(!(version>=3.0.0))) Failed publishing path=/apps/sample/tests, result=JcrResult[ success:false, exception: org.apache.sling.ide.transport.RepositoryException - javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}dependencies] Failed publishing path=/content/sample, result=JcrResult[ success:false, exception: org.apache.sling.ide.transport.RepositoryException - javax.jcr.nodetype.ConstraintViolationException: no matching child node definition found for {http://www.jcp.org/jcr/1.0}content]

It seems there is mismatch between Sling API version available in AEM 5.6.1 and version mentioned in pom.xml of generated project using plugin :

Below are maven co-ordinates that I get from felix console dependency finder  ( http://localhost:4502/system/console/depfinder) of AEM 5.6.1 :

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.api</artifactId> <version>2.4.3-R1488084</version> <scope>provided</scope> </dependency>

And project pom.xml has below entry :

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>aem-api</artifactId> <version>6.0.0.1</version> <scope>provided</scope> </dependency>

aem-api artifact jar has various important API class files eg: JCR,sling, granite, sightly.

So it seems sling version inside aem-api artifact is not matching with sling api version available in 5.6.1

Appreciate if any one can help to solve this issue !

Thanks,

Faizaan Shaikh

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

The sample archetype used by the AEM Eclipse Tools only works with AEM 6 or higher.

Regards,

Justin

View solution in original post

4 Replies

Avatar

Correct answer by
Employee

Hi,

The sample archetype used by the AEM Eclipse Tools only works with AEM 6 or higher.

Regards,

Justin

Avatar

Level 1

Hi Justin -

Understand the sample archetype is only for AEM 6 but http://docs.adobe.com/docs/en/dev-tools/aem-eclipse.html states that 5.6.1 is supported.  Is there any additional help for 5.6.1 developers?  Or is the only course of action to grab the v6 archetype and rework for 5.6.1 dependencies, etc?

Thanks -

Tom

Avatar

Employee

Hi,

If you want to generate a 5.6.1-compatible project, you have a few options:

1) Use one of the Maven archetypes listed here: http://docs.adobe.com/docs/en/cq/current/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html

2) Use the new lazybones project template, described here: https://github.com/Adobe-Consulting-Services/lazybones-aem-templates (Note - I haven't formally announced this yet, but that's mostly due to time constraints, not necessarily a reflection of the template's usability).

3) Use one of the other Maven archetypes generated by the community.

In all three cases, you need to enable the AEM plugin for the project after importing the project into Eclipse. This is done by selecting Configure -> Convert to Content Project... from the project's context menu.

Regards,
Justin

Avatar

Level 1

Thanks Justin - I'm up and running with 5.6.1 starting from multimodule-content-package-archetype.  Appreciate it -

- Tom