Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

OSGI Bundles and Archetype 10 Project

Avatar

Avatar
Validate 1
Level 2
SonalC
Level 2

Likes

4 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
SonalC
Level 2

Likes

4 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
SonalC
Level 2

04-01-2016

I was able to setup Archetype 10 type projects in Eclipse. I have few questions regarding the best practices followed during AEM development.

1. There is a core folder which I believe is used to write Java code. Now if a component which is present in apps folder refers a Java class, where should I write? Should it be present in core folder only?

2. The code inside the core folder is packaged into an OSGI jar and a bundle gets created. How should I go ahead if I want to create a 2nd bundle? Do I need to create a second Archetype 10 type project?

View Entire Topic

Avatar

Avatar
Validate 10
Level 2
SurendraKonatha
Level 2

Likes

5 likes

Total Posts

63 posts

Correct Reply

6 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
SurendraKonatha
Level 2

Likes

5 likes

Total Posts

63 posts

Correct Reply

6 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
SurendraKonatha
Level 2

03-02-2016

bsloki wrote...

Hi Sonal,

If you need to add just a different bundle, then you dont have to create a new project, instead you can just copy paste the core folder and make the few changes like

1. folder name

2. artifactId in the pom.xml

Now you can build both the bundles individually and deploy it on to the osgi container. 

If you add this bundle also to the parent pom.xml, then it also will be included when you build the whole project.

 

 

I did the same and cannot see the bundle deployed? Is that using Archetype10, we cannot use multiple modules? 

Our code structure:

The below does not create the bundle.

proj.core > src/main/java/org/myproj proj.it.launcher proj.it.tests proj.ui-apps pas.client [module we want to include] > src/main/java/org/myproj/pas > pom.xml pom.xml [Main pom]

If we move the "pas.client" sources to "proj.core", it is being included and we can use it in our main code.

proj.core > src/main/java/org/myproj > src/main/java/org/pas [module moved here] proj.it.launcher proj.it.tests proj.ui-apps pom.xml [Main pom]

But we wanted to have "pas.client" as a separate bundle. How can we do this?

The other option is see to create another Archetype10 project and include all our commonly used bundles (across projects) in this.