class WebsterMojo extends AbstractMojo {

    void addTargets(final @NotNull WebsterPlan.Builder builder,
                    final @NotNull Fun.ThrowingBiFunction<File, JsonObject, List<WebsterTarget>> parser)
            throws MojoFailureException {
        try {
            builder.withTargets(parser.tryApply(baseDir, websterTargets));
        } catch (Exception e) {
            throw new MojoFailureException("Failed to parse websterTargets", e);
        }
    }

}