I'm trying to add support to BootstrapInstaller to always upgrade bundles if the version ends in "SNAPSHOT" (this logic may need some refining, but let's assume for now that this is the right thing to do) and noticing what seems like an intractable problem with BootstrapInstaller's isAlreadyInstalled() method.

For context, I think there are three primary use cases for this feature:
1) Using mvn jetty:run (or similar in-place running of a webapp) where a bundle has changed.
2) Packaging a WAR file where a bundle has changed.
3) Running standalone where a bundle has changed.

I've been focusing on #1 because that's my personal itch to scratch.

The problem is that BootstrapInstaller.isAlreadyInstalled() only returns false if the launcher JAR file has changed which won't be the case in #1. There's code in getSelfTimestamp() that attempts to figure out if any bundles have changed, but this method looks at ${sling.home}/startup, the contents of which aren't changed unless isAlreadyInstalled() returns false. And getSelfTimestamp() can't look get timestamps for files in WEB-INF/resources/bundles because the ResourceProvider abstraction only exposes an InputStream.

I'm wondering if the whole isAlreadyInstalled() bit can be removed. And, if not, is it even useful to add reloading of SNAPSHOTs? I'll probably go ahead and submit the patch, but am now questioning the value. It seems to me that the change cycle for the launcher jar should be minimal compared with the initial bundle set.

Justin

Reply via email to