-
Bug
-
Resolution: Fixed
-
Neutral
-
4.5.17
-
None
The module descriptor file contains the version number of the module being installed. If the VersionHandler registers deltas for versions later than the version being installed then those deltas should not be executed.
Consider the scenario:
- I have version 1.0 installed in my webapp
- I install version 2.0 which contains deltas for future versions
For example my version handler for 2.0 looks like this:
public class TestModuleVersionHandler extends DefaultModuleVersionHandler { public TestModuleVersionHandler() { register(DeltaBuilder.update("999.0.0", "Updates for version 999.0.0") .addTask(new AbstractRepositoryTask("", "") { @Override protected void doExecute(InstallContext installContext) throws RepositoryException, TaskExecutionException { installContext.error("error", new IllegalStateException("this should not be executed...")); } }) ); } }
My test.xml looks like this:
<module> <name>test</name> <displayName>${project.name}</displayName> <description>${project.description}</description> <class>info.magnolia.TestModule</class> <versionHandler>info.magnolia.setup.TestModuleVersionHandler</versionHandler> <version>1.2.0</version>
Acceptance criteria