For now, the validation of the dependencies when hotreloading a package is done by calling the PackageManager#resolveDependencies method :
- In the operation used by the Browser extension : https://github.com/nuxeo/nuxeo/blob/master/nuxeo-features/nuxeo-admin-center/nuxeo-admin-center-core/src/main/java/org/nuxeo/ecm/admin/operation/HotReloadStudioSnapshot.java#L153
- In the JSF view for package management : https://github.com/nuxeo/nuxeo/blob/master/nuxeo-features/nuxeo-admin-center/nuxeo-admin-center-jsf/src/main/java/org/nuxeo/connect/client/jsf/AppCenterViewsManager.java#L445
This method does not only validate that a package has all its dependencies installed but also try to "resolve" them, which means :
- what versions are available and what is the best global match
- what needs to be uninstalled in case of conflict
- what needs to be reinstalled in cas of optional dependencies
As the hotreload feature does not allow to actually do what is needed when changes other than reinstall the target package are required, this "resolution" is not needed.
A solution that does not require a remote call to Connect could be to check only :
- if this package is already installed and dependencies/conflicts have changed, otherwise, no need for the other verifications
- if all the package direct dependencies are installed
- if there is no conflict between this package and the installed packages
- if there is no installed package with an optional dependency on this package
In the case one of these 3 last checks fails, we could then call the PackageManager#resolveDependencies method and suggest a solution that may need a restart of the server.