Write to repository on bundle install | Community
Skip to main content
New Participant
April 28, 2016
Solved

Write to repository on bundle install

  • April 28, 2016
  • 1 reply
  • 1065 views

I have a bundle that references a few groups. I'm familiar with how to create these groups programmatically with the usermanager, but I'm unsure when to do this.

Ideally, I would like to just run a script once on a bundle install that would check for the existence of the groups, and create them if they can't be found. Is it best to use a component with Immediate=true (and then shut that component down somehow?) or should tap into the bundle lifecyle using a bundle listener? Or is there a best practice that I'm not aware of?

FWIW, I'm using the AEM maven archetype V10

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Hi,

if you want to handle this on the bundle start, I would put this code into the BundleActivator.

Jörg

1 reply

joerghoh
joerghohAccepted solution
Employee
April 28, 2016

Hi,

if you want to handle this on the bundle start, I would put this code into the BundleActivator.

Jörg