adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
547 stars 423 forks source link

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

Closed sandeepkumar03 closed 7 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.

Also refer issue raised on AEM Plugin Page. This has some analysis done on this issue.

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.

pmminov commented 8 years ago

@sandeepkumar03 hey, not sure if it is related, but I'm not able to deploy a new core bundle at all. Is like no uninstallation is happening at all.

Whenever I run mvn clean install -PautoInstallPackage on my project the core bundle jar will not have any changes. I have to jump into CRXDE and manually delete the jar

I tried changing the filter.xml as you suggested but no results

sandeepkumar03 commented 8 years ago

I think bundle not getting installed at all would be a different issue. Just check if the build is created properly. Do you bundle inside see apps//install in the package?

Also there is a bug in Sling where the OSGi bundle is not installed due to "/system/sling/installer/jcr/pauseInstallation" node.

See if this node is there in your AEM instance. Try deleting the node and see if bundle gets installed.

There is hot fix for this issue which you can get from Adobe Day Care.

kwin commented 7 years ago

I also think that the filter rule in https://github.com/Adobe-Marketing-Cloud/aem-project-archetype/blob/master/src/main/archetype/ui.apps/src/main/content/META-INF/vault/filter.xml#L4 should be adjusted to not exclude anything. Otherwise bundle deployment might not work as expected.