I'm getting the following validation error for a content package which has a install hook configured:
Using install hooks in mutable content packages leads to deployment failures as the underlying service user on the publish does not have the right to execute those.
This install hook is only needed for local development and is only enabled by an Maven extra profile.
Therefore I tried to disable the error through the allowHooksInMutableContent property, but the error is still reported.
After checking the code it seem the following line is missing a check for the allowHooksInMutableContent variable:
|
if (PackageType.CONTENT.equals(packageType)) { |
It probably should look like this:
if (PackageType.CONTENT.equals(packageType) && !allowHooksInMutableContent) {
return Collections.singleton(new ValidationMessage(defaultSeverity, VIOLATION_MESSAGE_INSTALL_HOOK_IN_MUTABLE_PACKAGE));
}
Also I don't understand the code enough, as it seems strange to me that there are three checks for the install hooks in the same file.