All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.maven.plugins.jgitflow.provider.VersionProvider Maven / Gradle / Ivy

There is a newer version: 1.0-m5.1
Show newest version
package com.atlassian.maven.plugins.jgitflow.provider;

import java.util.List;
import java.util.Map;

import com.atlassian.maven.plugins.jgitflow.VersionType;
import com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException;

import org.apache.maven.project.MavenProject;

/**
 * Helper class for getting a map that contains module -> version strings.
 * This is used to get versions for all projects/submodule in a maven reacotr list
 */
public interface VersionProvider
{
    Map getNextVersionsForType(VersionType versionType, ProjectCacheKey cacheKey, List reactorProjects) throws MavenJGitFlowException;
    
    /**
     * Returns the (next) release versions for all of the projects in the reactor.
     * If defaultReleaseVersion is defined, it will use that for the root project as well as all sub modules if autoVersionSubmodules is true.
     * If defaultReleaseVersion is not defined, or if autoVersionSubmodules is false, it will prompt the user for the release version for any
     * version in the reactor that is currently a SNAPSHOT
     * 
     * @param cacheKey The cacheKey to use when looking for versions so we don't have to loop over the reactor everytime
     * @param reactorProjects The set of reactorProjects to loop over
     * @param ctx The ReleaseContext for JGitFlow
     * @return A Map where the key is the project/module key and the value is the release version
     * @throws com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException
     */
    Map getNextReleaseVersions(ProjectCacheKey cacheKey, List reactorProjects) throws MavenJGitFlowException;

    /**
     * Returns the (next) hotfix versions for all of the projects in the reactor.
     * If defaultReleaseVersion is defined, it will use that for the root project as well as all sub modules if autoVersionSubmodules is true.
     * If defaultReleaseVersion is not defined, or if autoVersionSubmodules is false, it will prompt the user for the hotfix version for any
     * version in the reactor that is currently a SNAPSHOT
     *
     * @param cacheKey The cacheKey to use when looking for versions so we don't have to loop over the reactor everytime
     * @param reactorProjects The set of reactorProjects to loop over
     * @param ctx The ReleaseContext for JGitFlow
     * @return A Map where the key is the project/module key and the value is the hotfix version
     * @throws com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException
     */
    Map getNextHotfixVersions(ProjectCacheKey cacheKey, List reactorProjects) throws MavenJGitFlowException;

    /**
     * Returns the (next) development versions for all of the projects in the reactor.
     * If defaultDevelopmentVersion is defined, it will use that for the root project as well as all sub modules if autoVersionSubmodules is true.
     * If defaultDevelopmentVersion is not defined, or if autoVersionSubmodules is false, it will prompt the user for the development version for any
     * version in the reactor that is currently a not a SNAPSHOT
     *
     * @param cacheKey The cacheKey to use when looking for versions so we don't have to loop over the reactor everytime
     * @param reactorProjects The set of reactorProjects to loop over
     * @param ctx The ReleaseContext for JGitFlow
     * @return A Map where the key is the project/module key and the value is the release version
     * @throws com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException
     */
    Map getNextDevelopmentVersions(ProjectCacheKey cacheKey, List reactorProjects) throws MavenJGitFlowException;

    /**
     * Returns the last release versions for all of the projects in the reactor.
     * 
     * @param cacheKey The cacheKey to use when looking for versions so we don't have to loop over the reactor everytime
     * @param reactorProjects The set of reactorProjects to loop over
     * @param ctx The ReleaseContext for JGitFlow
     * @return A Map where the key is the project/module key and the value is the release version
     * @throws com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException
     */
    Map getLastReleaseVersions(MavenProject rootProject) throws MavenJGitFlowException;

    /**
     * Returns the current versions for all of the projects in the reactor.
     *
     * @param cacheKey The cacheKey to use when looking for versions so we don't have to loop over the reactor everytime
     * @param reactorProjects The set of reactorProjects to loop over
     * @return A Map where the key is the project/module key and the value is the version
     */
    Map getOriginalVersions(ProjectCacheKey cacheKey, List reactorProjects);

    /**
     * Returns the current versions for all of the projects in the reactor.
     * This method never looks up from cache.
     *
     * @param reactorProjects The set of reactorProjects to loop over
     * @return A Map where the key is the project/module key and the value is the version
     */
    Map getOriginalVersions(List reactorProjects);
    
    String getRootVersion(ProjectCacheKey cacheKey, List reactorProjects);

    String getRootVersion(List reactorProjects);
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy