Package com.atlassian.maven.plugins.jgitflow

Examples of com.atlassian.maven.plugins.jgitflow.ReleaseContext


    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") adding snapshot to pom versions...");
       
        final ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);

        Map<String, String> nonSnapshotVersions = versionProvider.getNextVersionsForType(versionType, cacheKey, reactorProjects);

        final String delimitedVersionSuffix = getDelimitedVersionSuffix(versionSuffix);
       
        Map<String, String> snapshotVersions = Maps.transformValues(nonSnapshotVersions, new Function<String, String>()
        {
            @Override
            public String apply(String input)
            {
                return input + delimitedVersionSuffix + "-SNAPSHOT";
            }
        });

        doUpdate(reactorProjects, originalVersions, snapshotVersions, ctx.isUpdateDependencies());
    }
View Full Code Here


    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") copying pom versions...");
       
        ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(projectsToUpdate);
        Map<String, String> versionsToCopy = versionProvider.getOriginalVersions(projectsToCopy);

        doUpdate(projectsToUpdate, originalVersions, versionsToCopy, ctx.isUpdateDependencies());
    }
View Full Code Here

    @Override
    public void copyPomVersionsFromMap(Map<String, String> versionsToCopy,List<MavenProject> projectsToUpdate) throws MavenJGitFlowException
    {
        getLogger().info("copying pom versions...");
       
        ReleaseContext ctx = contextProvider.getContext();
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(projectsToUpdate);

        doUpdate(projectsToUpdate, originalVersions, versionsToCopy, ctx.isUpdateDependencies());
    }
View Full Code Here

    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") updating poms with next development version...");
       
        ReleaseContext ctx = contextProvider.getContext();
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);
        Map<String, String> developmentVersions = versionProvider.getNextDevelopmentVersions(cacheKey, reactorProjects);

        doUpdate(reactorProjects, originalVersions, developmentVersions, ctx.isUpdateDependencies());
    }
View Full Code Here

    public void addFeatureVersionToSnapshotVersions(ProjectCacheKey cacheKey, final String featureVersion, List<MavenProject> reactorProjects) throws MavenJGitFlowException
    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") adding feature versions to poms...");
        ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);

        Map<String, String> featureSuffixedVersions = Maps.transformValues(originalVersions, new Function<String, String>()
        {
            @Override
            public String apply(String input)
            {
                if (input.endsWith("-SNAPSHOT"))
                {
                    return StringUtils.substringBeforeLast(input, "-SNAPSHOT") + "-" + featureVersion + "-SNAPSHOT";
                }
                else
                {
                    return input;
                }
            }
        });

        doUpdate(reactorProjects, originalVersions, featureSuffixedVersions, ctx.isUpdateDependencies());
    }
View Full Code Here

    public void removeFeatureVersionFromSnapshotVersions(ProjectCacheKey cacheKey, final String featureVersion, List<MavenProject> reactorProjects) throws MavenJGitFlowException
    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") removing feature versions to poms...");
        ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);

        final String featureSuffix = "-" + featureVersion + "-SNAPSHOT";

        Map<String, String> featureVersions = Maps.transformValues(originalVersions, new Function<String, String>()
        {
            @Override
            public String apply(String input)
            {
                if (input.endsWith(featureSuffix))
                {
                    return StringUtils.substringBeforeLast(input, featureSuffix) + "-SNAPSHOT";
                }
                else
                {
                    return input;
                }
            }
        });

        doUpdate(reactorProjects, originalVersions, featureVersions, ctx.isUpdateDependencies());
    }
View Full Code Here

    }

    @Override
    public void removeSnapshotFromFeatureVersions(ProjectCacheKey cacheKey, final String featureVersion, List<MavenProject> reactorProjects) throws MavenJGitFlowException
    {
        ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);

        Map<String, String> featureVersions = Maps.transformValues(originalVersions, new Function<String, String>()
        {
            @Override
            public String apply(String input)
            {
                if (input.endsWith("-SNAPSHOT"))
                {
                    return StringUtils.substringBeforeLast(input, "-SNAPSHOT") + "-" + featureVersion;
                }
                else
                {
                    return input;
                }
            }
        });

        doUpdate(reactorProjects, originalVersions, featureVersions, ctx.isUpdateDependencies());
    }
View Full Code Here

    private ContextProvider contextProvider;

    @Override
    public void execute(MavenProject project, MavenSession session) throws MavenExecutorException
    {
        ReleaseContext ctx = contextProvider.getContext();

        String goal = "clean deploy";

        if (ctx.isNoDeploy())
        {
            goal = "clean install";
        }

        execute(project, session, goal);
View Full Code Here

    }

    @Override
    public void execute(MavenProject project, MavenSession session, String goals) throws MavenExecutorException
    {
        ReleaseContext ctx = contextProvider.getContext();

        List<String> argList = new ArrayList<String>();

        Properties userProps = session.getUserProperties();

        for (String key : userProps.stringPropertyNames())
        {
            argList.add("-D" + key + "=" + userProps.getProperty(key));
        }

        if (ctx.isUseReleaseProfile())
        {
            argList.add("-DperformRelease=true");
        }

        for (String profileId : getActiveProfileIds(project, session))
        {
            argList.add("-P" + profileId);
        }

        String additionalArgs = Joiner.on(" ").join(argList);

        ReleaseResult result = new ReleaseResult();
        ReleaseEnvironment env = new DefaultReleaseEnvironment();
        env.setSettings(session.getSettings());
        MavenExecutor mavenExecutor = mavenExecutors.get(env.getMavenExecutorId());

        mavenExecutor.executeGoals(ctx.getBaseDir(), goals, env, ctx.isInteractive(), additionalArgs, result);

    }
View Full Code Here

    }

    @Override
    public void setupCredentialProviders() throws JGitFlowException
    {
        ReleaseContext ctx = contextProvider.getContext();

        if (!ctx.isRemoteAllowed())
        {
            return;
        }

        if (!sshConsoleInstalled)
View Full Code Here

TOP

Related Classes of com.atlassian.maven.plugins.jgitflow.ReleaseContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.