You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2023/10/20 15:14:14 UTC

[sling-ide-tooling] branch master updated: SLING-12108 Do no longer manually start bundles (#23)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-ide-tooling.git


The following commit(s) were added to refs/heads/master by this push:
     new 94efad17 SLING-12108 Do no longer manually start bundles (#23)
94efad17 is described below

commit 94efad17f0d699b3670d4dedd0b4c1390891dcd3
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Oct 20 17:14:08 2023 +0200

    SLING-12108 Do no longer manually start bundles (#23)
    
    Instead rely on Equinox's lazy-loading
    Hopefully this will lead to a working bundle starting order
---
 .../apache/sling/ide/eclipse/core/internal/Activator.java  | 12 ++----------
 shared/parent/pom.xml                                      | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/eclipse/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/Activator.java b/eclipse/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/Activator.java
index 11f8ad97..13e51860 100644
--- a/eclipse/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/Activator.java
+++ b/eclipse/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/Activator.java
@@ -66,16 +66,8 @@ public class Activator extends Plugin {
     public static final String BSN_ARTIFACTS = "org.apache.sling.ide.artifacts";
 
 	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-		
-		// the following bundles need to be explicitly started as no class is directly referenced
-		// and everything works via declarative services
-		// compare with https://github.com/eclipse-m2e/m2e-core/issues/945
-		getFirstBundle(context, BSN_API).start();
-		getFirstBundle(context, BSN_VAULT_IMPL).start();
-		getFirstBundle(context, BSN_ARTIFACTS).start();
-		
+        super.start(context);
+        plugin = this;
         repositoryFactory = new ExtendedServiceTracker<>(context, RepositoryFactory.class);
         serializationManager = new ExtendedServiceTracker<>(context, SerializationManager.class);
         filterLocator = new ExtendedServiceTracker<>(context, FilterLocator.class);
diff --git a/shared/parent/pom.xml b/shared/parent/pom.xml
index b395f03e..7e4c9bbc 100644
--- a/shared/parent/pom.xml
+++ b/shared/parent/pom.xml
@@ -37,6 +37,20 @@
     <build>
         <pluginManagement>
             <plugins>
+                <plugin>
+                    <groupId>biz.aQute.bnd</groupId>
+                    <artifactId>bnd-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>bnd-process</id>
+                            <configuration>
+                                <!-- due to the non-Maven standard merging this is effectively added to the config set in sling-bundle-parent -->
+                                <!-- make sure to automatically start this bundle in Equinox whenever some classes are referenced -->
+                                <bnd>Bundle-ActivationPolicy: lazy</bnd>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
                 <plugin>
                     <groupId>biz.aQute.bnd</groupId>
                     <artifactId>bnd-baseline-maven-plugin</artifactId>