sling context aware configuration context-aware-configuration-bnd-plugin not working as expected

Avatar

Avatar
Validate 1
Level 2
srikanthg212933
Level 2

Likes

4 likes

Total Posts

37 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
srikanthg212933
Level 2

Likes

4 likes

Total Posts

37 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
srikanthg212933
Level 2

14-06-2020

Hi Everyone,

 

I am trying to use sling context aware configurations inside AEM 6.5 project to store some configurations.

As described here https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...

 

I have tried adding bnd statement with below plugin

org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin

 But still my bundle is not able to identify configuration files (annotated with @Configuration) after deploying it into OSGI.

And If i manually add like below then only it started identifying 

Sling-ContextAware-Configuration-Classes:com.abc.caconfigs.MySampleConfig

 Could you guys please let me know how can we do it without adding each class names and should make it work with only plugin? .

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-06-2020

I have a working example at https://github.com/joerghoh/cqdump/tree/master/ca-config-example which also includes the mentioned plugin.

The maven-bundle-plugin is configured here: https://github.com/joerghoh/cqdump/blob/master/ca-config-example/core/pom.xml

 

Jörg

 

// Update: I do use the maven-bundle-plugin and not the bnd-maven-plugin.

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

14-06-2020

Did you tried below ?

<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
<configuration>
					<bnd><![CDATA[
						-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin
                                ]]></bnd>
				</configuration>
				<executions>
					<execution>
						<id>bnd-process</id>
						<goals>
							<goal>bnd-process</goal>
						</goals>
						<configuration>
							<bnd><![CDATA[
						Bundle-Category: MyApp
						Sling-Model-Packages: com.aem.core.models
						-snapshot: ${tstamp;yyyyMMddHHmmssSSS}
						Bundle-DocURL:
                                ]]></bnd>
						</configuration>
					</execution>
				</executions>
			</plugin>