Senast uppdaterad den
2 maj 2021
Steps
To create a package that installs a new version of an OSGi bundle and deletes the older version, you can use a filter like this:
<?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/apps/myapp/install"> <exclude pattern="/apps/myapp/install/.*"/> <include pattern="/apps/myapp/install/custombundle-.*"/> </filter> </workspaceFilter>
Here's an example scenario for the filter above:
- Create a package using the filter above, the package should only contain one file /apps/myapp/install/custombundle-2.0.0.jar
- When you upload and install the package, AEM already has the older version installed /apps/myapp/install/custombundle-1.0.0.jar.
- When the package is installed, it deletes /apps/myapp/install/custombundle-1.0.0.jar and install /apps/myapp/install/custombundle-2.0.0.jar instead without affecting any other files under /apps/myapp/install.