@Override
  public void execute(GitFlowConfiguration configuration, Git git, JGitFlowCommand gitFlowCommand)
      throws JGitFlowExtensionException {
    try {
      BranchType branchType = branchHelper.getCurrentBranchType();
      ProjectCacheKey cacheKey = null;

      switch (branchType) {
        case RELEASE:
          cacheKey = ProjectCacheKey.RELEASE_BRANCH;
          break;

        case HOTFIX:
          cacheKey = ProjectCacheKey.HOTFIX_BRANCH;
          break;

        case DEVELOP:
          cacheKey = ProjectCacheKey.DEVELOP_BRANCH;
          break;

        case MASTER:
          cacheKey = ProjectCacheKey.MASTER_BRANCH;
          break;

        case FEATURE:
          cacheKey = ProjectCacheKey.FEATURE_BRANCH;
          break;

        default:
          throw new JGitFlowExtensionException(
              "Unsupported branch type '"
                  + branchType.name()
                  + "' while running "
                  + this.getClass().getSimpleName()
                  + " command");
      }

      ReleaseContext ctx = contextProvider.getContext();
      List<MavenProject> branchProjects = branchHelper.getProjectsForCurrentBranch();

      projectHelper.checkPomForVersionState(VersionState.RELEASE, branchProjects);

      if (!ctx.isAllowSnapshots()) {
        List<String> snapshots =
            projectHelper.checkForNonReactorSnapshots(cacheKey, branchProjects);
        if (!snapshots.isEmpty()) {
          String details = Joiner.on(ls).join(snapshots);
          throw new UnresolvedSnapshotsException(
              "Cannot finish a "
                  + branchType.name().toLowerCase()
                  + " due to snapshot dependencies:"
                  + ls
                  + details);
        }
      }
    } catch (Exception e) {
      throw new JGitFlowExtensionException(
          "Error verifying version state in poms: " + e.getMessage(), e);
    }
  }