[AEM 6.5] Project archetype and maven dependencies that are embedded

Avatar

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile
shea8511
Level 2

22-06-2021

Hi, I am working on a project that was created recently using the AEM 6.5 archetype base project for best practices LINK and we have run into a few scenarios where we have added a dependency, then we code/build/deploy and the bundle will not start because it cannot import a needed package. I guess it is expecting to find the package exported from some other OSGi bundle.

We solve this by adding the needed packages to the bnd-maven-plugin config under "-conditionalpackage" LINK

Unfortunately, sometimes this leads us down a "rabbit hole" where we have to add a lot of packages, and end up pulling in tons of dependencies just so we can use like one class.

  1. Are we doing this the correct/ideal way?
  2. Is this maintainable? What if we keep doing this for years and end up with 50 packages and a 500mb+ bundle size

Thanks.

Replies

Avatar

Avatar
Establish
Level 4
kchaurasiya
Level 4

Likes

70 likes

Total Posts

65 posts

Correct reply

10 solutions
Top badges earned
Establish
View profile

Avatar
Establish
Level 4
kchaurasiya
Level 4

Likes

70 likes

Total Posts

65 posts

Correct reply

10 solutions
Top badges earned
Establish
View profile
kchaurasiya
Level 4

22-06-2021

@shea8511 : Did you try to install the service package on your AEM instance? If not then try to install the aem-service-pkg-6.5.4.zip service package.

 

Note -  Once you setup the AEM instance just install the service package first then try to install the other packages(code package, conf package, content package, user packages and others)

kchaurasiya_0-1624423007595.png

 

Thank You.

Avatar

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile
shea8511
Level 2

23-06-2021

We already have the service pack installed. I am not referring to dependencies provided by this. My situation is when I add maven dependencies, perhaps ones I have created myself, to the project.

Avatar

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile

Avatar
Affirm 1
Level 2
shea8511
Level 2

Likes

3 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
Ignite 1
Give Back 3
View profile
shea8511
Level 2

23-06-2021

This post has helped me a lot. Still trying to figure out the proper solution though. https://groups.google.com/g/bndtools-users/c/NAdU0_X8OKY

Avatar

Avatar
Boost 250
MVP
shelly-goel
MVP

Likes

250 likes

Total Posts

410 posts

Correct reply

107 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
Ignite 3
Give Back 10
View profile

Avatar
Boost 250
MVP
shelly-goel
MVP

Likes

250 likes

Total Posts

410 posts

Correct reply

107 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
Ignite 3
Give Back 10
View profile
shelly-goel
MVP

26-06-2021

@shea8511 Are these all external dependencies and not provided by AEM? You can check each of these dependencies if they are already provided in /system/console/depfinder if you find an existing bundle, note the version and use this same version in your pom.xml dependencies section also add the scope as provided. This way you can reduce a lot of exports.