adobe / aem-eclipse-developer-tools

The Eclipse plugin that brings you the full connection to the Adobe Experience Manager, with auto-sync and project creation wizard.
Apache License 2.0
35 stars 23 forks source link

OSGi bundle not getting uninstalled in case un-installation is done after new version installation of AEM package #68

Closed sandeepkumar03 closed 8 years ago

sandeepkumar03 commented 8 years ago

When we are overwriting a new package with new version, on un-installation the OSGi bundle is not getting removed from web console. Following are the steps to reproduce.

  1. Create a new multimodule project from AEM Plugin
  2. Build and deploy to AEM instance in Package Manager. (OSGi console shows bundle with version A)
  3. Change the version of project created in step 1 to something different say B.
  4. Build and deploy to AEM instance in Package Manager (OSGi console shows bundle with version B)
  5. Uninstall the AEM package from Package Manager.
  6. Notice that OSGi console still shows bundle with version B. It should be version A.

Additional Info - The issue is not reproducible when generating mutimodule project through maven archetype through command line. But for the project generated through AEM plugin gives issue. Had raised ticket with Day Care, they redirected to Github page of AEM plugin. AEM Version - AEM 6.1

rombert commented 8 years ago

Just to make sure I understand your issue,are you using the IDE tooling just to create the project from the archetype?

sandeepkumar03 commented 8 years ago

Yes @rombert, I am using IDE tooling to create project from the archetype.

sandeepkumar03 commented 8 years ago

Some more additional info @rombert ,

From the archetypes list

Following works fine

<groupId>com.day.jcr.vault</groupId>
<artifactId>multimodule-content-package-archetype</artifactId>

While following does not

<groupId>com.adobe.granite.archetypes</groupId>
<artifactId>aem-project-archetype</artifactId>

The aem-project-archetype generates extra exclude pattern

<filter root="/apps/myapp">
    <exclude pattern="/apps/myapp/install" />
</filter>

This exclude pattern is not present in the multimodule-content-package-archetype

Did few tests, after we remove this from filter, the aem-project-archetype works fine, not sure if there would be any side-effects due to this.

Looks like issue with aem-project-archetype. Do you think the same?

eglistefan commented 8 years ago

I think the problem is in the nature of the chosen archetype behavior: @sandeepkumar03, as you pointed out the /apps/myapp/install folder is excluded from the package - with the idea that it gets installed directly by a bundle upload (via org.apache.sling.tooling.support.install bundle). That also means that if you remove the package, that the uploaded bundle is independent and thus doesn't get removed.

sandeepkumar03 commented 8 years ago

@eglistefan One observation is that, the problem occurs only when we overwrite the package and then uninstall. If we just install package and uninstall package, the OSGi bundle is removed from OSGi console automatically, though filter definition has exclude pattern, still it works fine.

If removing the exclude pattern from filter seems to be fine, would raise an issue with aem-project-archetype

Let me know, if I should close this issue.

eglistefan commented 8 years ago

@sandeepkumar03 - haven't tested the different when creating the projects via maven vs via the eclipse plugin - but what I can see is that uninstalling version B from package manager leaves version A installed - which means it doesn't remove the /apps/myapp/install - which is why the bundle is still there. So deleting after uninstall of B, then also uninstalling A removes the bundle.

sandeepkumar03 commented 8 years ago

Closing this issue, as the issue is raised for archetype separately.