class DeploymentVerifier {

    public void verifyWithException(final Module module,
                                    DeploymentMode deploymentMode) {
        if (DeploymentMode.VALIDATED.equals(deploymentMode)) {
            // Check is the POM's GAV resolves to any pre-existing artifacts.
            final GAV gav = module.getPom().getGav();
            if (gav.isSnapshot()) {
                return;
            }
            final ModuleRepositories projectRepositories = moduleRepositoriesService.load(((KieModule) module).getRepositoriesPath());
            final Set<MavenRepositoryMetadata> repositories = repositoryResolver.getRepositoriesResolvingArtifact(gav,
                                                                                                                  module,
                                                                                                                  projectRepositories.filterByIncluded());
            if (repositories.size() > 0) {
                throw new GAVAlreadyExistsException(gav,
                                                    repositories);
            }
        }
    }

    public  DeploymentVerifier();
    @Inject public  DeploymentVerifier(final ModuleRepositoryResolver repositoryResolver,
                              final ModuleRepositoriesService moduleRepositoriesService);

}