내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Sling Models in AEM 5.6.1?

Avatar

Level 2

I recently read a great article on apache sling models and I thought I would try to put it to use in AEM 5.6.1 but I am having trouble getting the dependecies and maven-bundle-plugin settings just right. Has anyone else tried this with success?

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

Hi,

The fastest way to get started with Sling Models on 5.6.1 is to download the package from https://github.com/Adobe-Consulting-Services/com.adobe.acs.bundles.sling-models/releases/tag/com.ado... and install it in your AEM instance. This will give you the two bundles you need at runtime.

Then, in your bundle project, you need to do two things (aside from actually creating the model classes/interfaces):

1. Add this dependency:

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.api</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency>

2. In the <configuration> element inside the plugin definition for the maven-bundle-plugin add this:

<instructions> <Sling-Model-Packages> com.myco.mypackage </Sling-Model-Packages> </instructions>

Note that you might already have an <instructions> element, in which case just add <Sling-Model-Packages> inside that existing <instructions> element.

If this doesn't solve your problem, please post more details on exactly what is going wrong.

Regards,

Justin

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Employee

Hi,

The fastest way to get started with Sling Models on 5.6.1 is to download the package from https://github.com/Adobe-Consulting-Services/com.adobe.acs.bundles.sling-models/releases/tag/com.ado... and install it in your AEM instance. This will give you the two bundles you need at runtime.

Then, in your bundle project, you need to do two things (aside from actually creating the model classes/interfaces):

1. Add this dependency:

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.api</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency>

2. In the <configuration> element inside the plugin definition for the maven-bundle-plugin add this:

<instructions> <Sling-Model-Packages> com.myco.mypackage </Sling-Model-Packages> </instructions>

Note that you might already have an <instructions> element, in which case just add <Sling-Model-Packages> inside that existing <instructions> element.

If this doesn't solve your problem, please post more details on exactly what is going wrong.

Regards,

Justin

Avatar

이전 커뮤니티 멤버

dnelson42 wrote...

I recently read a great article on apache sling models and I thought I would try to put it to use in AEM 5.6.1 but I am having trouble getting the dependecies and maven-bundle-plugin settings just right. Has anyone else tried this with success?

 


Care to share the article URL?

This is an area that I am currently considering. I am aware of this link :-

http://sling.apache.org/documentation/bundles/models.html

and have also been reading about Cognifide's 'Slice' implementation :-

http://www.cognifide.com/blogs/cq/make-your-cq-life-easier-with-slice/

Regards

Fraser