Package com.atlassian.maven.plugins.jgitflow

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


        initialCommitAll(flow);

        FlowReleaseManager relman = getFeatureManager();

        ReleaseContext ctx = new ReleaseContext(projectRoot);
        ctx.setInteractive(false).setDefaultFeatureName(FEATURE_NAME).setEnableFeatureVersions(true);

        MavenSession session = new MavenSession(getContainer(), new Settings(), localRepository, null, null, null, projectRoot.getAbsolutePath(), new Properties(), new Properties(), null);

        relman.start(ctx, projects, session);
View Full Code Here


    @Override
    public void execute(GitFlowConfiguration configuration, Git git, JGitFlowCommand gitFlowCommand, JGitFlowReporter reporter) throws JGitFlowExtensionException
    {
        try
        {
            ReleaseContext ctx = contextProvider.getContext();
            SessionAndProjects sap = branchHelper.getSessionAndProjectsForCurrentBranch();

            MavenProject rootProject = ReleaseUtil.getRootProject(sap.getProjects());

            if (!ctx.isNoBuild())
            {
                mavenExecutionHelper.execute(rootProject, sap.getSession());
            }
        }
        catch (Exception e)
View Full Code Here

    @Override
    public String getFeatureStartName() throws MavenJGitFlowException
    {
        try
        {
            ReleaseContext ctx = contextProvider.getContext();
            JGitFlow flow = jGitFlowProvider.gitFlow();

            String featureName = StringUtils.defaultString(ctx.getDefaultFeatureName());

            if (ctx.isInteractive())
            {
                featureName = promptForFeatureName(flow.getFeatureBranchPrefix(), featureName);
            }
            else
            {
View Full Code Here

        Thread.currentThread().setContextClassLoader(getClassloader(getClasspath()));
       
        MavenReleaseStartExtension extensionObject = (MavenReleaseStartExtension) getExtensionInstance(releaseStartExtension);
       
        ReleaseContext ctx = new ReleaseContext(getBasedir());
        ctx.setAutoVersionSubmodules(autoVersionSubmodules)
           .setInteractive(getSettings().isInteractiveMode())
           .setDefaultReleaseVersion(releaseVersion)
           .setDefaultDevelopmentVersion(developmentVersion)
           .setReleaseBranchVersionSuffix(releaseBranchVersionSuffix)
           .setAllowSnapshots(allowSnapshots)
View Full Code Here

        catch (JGitFlowException e)
        {
            throw new MavenJGitFlowException(e);
        }

        ReleaseContext ctx = contextProvider.getContext();

        String featureName = StringUtils.defaultString(ctx.getDefaultFeatureName());

        if (StringUtils.isBlank(featureName))
        {
            String currentBranch = null;

            try
            {
                currentBranch = flow.git().getRepository().getBranch();
                getLogger().debug("Current Branch is: " + currentBranch);
            }
            catch (IOException e)
            {
                throw new MavenJGitFlowException(e);
            }

            getLogger().debug("Feature Prefix is: " + flow.getFeatureBranchPrefix());
            getLogger().debug("Branch starts with feature prefix?: " + currentBranch.startsWith(flow.getFeatureBranchPrefix()));
            if (currentBranch.startsWith(flow.getFeatureBranchPrefix()))
            {
                featureName = currentBranch.replaceFirst(flow.getFeatureBranchPrefix(), "");
            }
        }

        if (ctx.isInteractive())
        {
            List<String> possibleValues = new ArrayList<String>();
            if (null == featureName)
            {
                featureName = "";
View Full Code Here

    @Override
    public void execute(GitFlowConfiguration configuration, Git git, JGitFlowCommand gitFlowCommand, JGitFlowReporter reporter) throws JGitFlowExtensionException
    {
        try
        {
            ReleaseContext ctx = contextProvider.getContext();

            versionCacheProvider.cacheCurrentBranchVersions();
           
            String currentName = branchHelper.getCurrentBranchName();

            List<MavenProject> currentProjects = branchHelper.getProjectsForCurrentBranch();

            List<MavenProject> hotfixProjects = branchHelper.getProjectsForTopicBranch(BranchType.HOTFIX);

            pomUpdater.copyPomVersionsFromProject(hotfixProjects, currentProjects);
            projectHelper.commitAllPoms(git, currentProjects, ctx.getScmCommentPrefix() + "Updating " + currentName + " poms to hotfix version to avoid merge conflicts" + ctx.getScmCommentSuffix());
        }
        catch (Exception e)
        {
            throw new JGitFlowExtensionException("Error updating current branch poms to hotfix version", e);
        }
View Full Code Here

        }
    }

    protected void setupProviders(MavenSession session, List<MavenProject> projects)
    {
        contextProvider.setContext(new ReleaseContext(getBasedir()));
        sessionProvider.setSession(session);
        projectsProvider.setReactorProjects(projects);
    }
View Full Code Here

        Thread.currentThread().setContextClassLoader(getClassloader(getClasspath()));
       
        MavenReleaseFinishExtension extensionObject = (MavenReleaseFinishExtension) getExtensionInstance(releaseFinishExtension);
       
        ReleaseContext ctx = new ReleaseContext(getBasedir());
        ctx.setInteractive(getSettings().isInteractiveMode())
                .setAutoVersionSubmodules(autoVersionSubmodules)
                .setReleaseBranchVersionSuffix(releaseBranchVersionSuffix)
                .setPushReleases(pushReleases)
                .setKeepBranch(keepBranch)
                .setSquash(squash)
View Full Code Here

    {
        String unprefixedBranchName = "";

        try
        {
            ReleaseContext ctx = contextProvider.getContext();

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

            JGitFlow flow = jGitFlowProvider.gitFlow();

            unprefixedBranchName = branchHelper.getUnprefixedCurrentBranchName();

            //reload the reactor projects for release
            List<MavenProject> branchProjects = branchHelper.getProjectsForCurrentBranch();

            String featureVersion = NamingUtil.camelCaseOrSpaceToDashed(unprefixedBranchName);
            featureVersion = StringUtils.replace(featureVersion, "-", "_");

            pomUpdater.removeFeatureVersionFromSnapshotVersions(ProjectCacheKey.FEATURE_FINISH_LABEL, featureVersion, branchProjects);

            projectHelper.commitAllPoms(flow.git(), branchProjects, ctx.getScmCommentPrefix() + "updating poms for " + featureVersion + " version" + ctx.getScmCommentSuffix());

        }
        catch (Exception e)
        {
            throw new JGitFlowExtensionException("Error updating poms with feature versions for branch '" + unprefixedBranchName + "'");
View Full Code Here

                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);
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.