-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
5.3.6
-
None
When using the ModuleBootstrapTask I don't have the possiblity to tell it, what should happen if there's a conflict with the UUIDs. So far I always created my own Task that is basically the same as the ModuleBootstrapTask, but it takes an int as parameter in the constructor which is then passed on to BootstrapResourcesTask as ImportUUIDBehavior:
package ch.screenconcept.nobel.setup; import info.magnolia.module.InstallContext; import info.magnolia.module.delta.BootstrapResourcesTask; public class CustomBootstrapTask extends BootstrapResourcesTask { public CustomBootstrapTask(int importBehavior) { super("Bootstrap", "Bootstraps the necessary module repository content.", importBehavior); } /** * Accepts any resource under "/mgnl-bootstrap/moduleName" including any * subfolders. */ @Override protected boolean acceptResource(InstallContext ctx, String resourceName) { final String moduleName = ctx.getCurrentModuleDefinition().getName(); return resourceName.startsWith("/mgnl-bootstrap/" + moduleName + "/") && resourceName.endsWith(".xml"); } }
I was wondering if it wouldn't make sense to add a constructor to ModuleBootstrapTask, allowing devs to specify the behavior on UUID conflicts. Because as it is installation or update of the module just fails and it's quite annoying to fix the xml in order for the update to work. Unfortunately, if multiple people work on a project, those conflicts happen from time to time.
Acceptance criteria