Package com.atlassian.maven.plugins.jgitflow

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


    {
        String projectName = "internal-differing-snapshot-dependencies";
        List<MavenProject> projects = createReactorProjects("rewrite-for-hotfix", projectName);
        File projectRoot = projects.get(0).getBasedir();

        ReleaseContext ctx = new ReleaseContext(projectRoot);

        ctx.setInteractive(false).setNoTag(true).setAllowSnapshots(true);

        basicHotfixRewriteTest(projectName, ctx);
    }
View Full Code Here


    {
        String projectName = "internal-differing-snapshot-extension";
        List<MavenProject> projects = createReactorProjects("rewrite-for-hotfix", projectName);
        File projectRoot = projects.get(0).getBasedir();

        ReleaseContext ctx = new ReleaseContext(projectRoot);

        ctx.setInteractive(false).setNoTag(true).setAllowSnapshots(true);

        basicHotfixRewriteTest(projectName, ctx);
    }
View Full Code Here

    {
        String projectName = "internal-differing-snapshot-plugins";
        List<MavenProject> projects = createReactorProjects("rewrite-for-hotfix", projectName);
        File projectRoot = projects.get(0).getBasedir();

        ReleaseContext ctx = new ReleaseContext(projectRoot);

        ctx.setInteractive(false).setNoTag(true).setAllowSnapshots(true);

        basicHotfixRewriteTest(projectName, ctx);
    }
View Full Code Here

    {
        String projectName = "internal-differing-snapshot-report-plugins";
        List<MavenProject> projects = createReactorProjects("rewrite-for-hotfix", projectName);
        File projectRoot = projects.get(0).getBasedir();

        ReleaseContext ctx = new ReleaseContext(projectRoot);

        ctx.setInteractive(false).setNoTag(true).setAllowSnapshots(true);

        basicHotfixRewriteTest(projectName, ctx);
    }
View Full Code Here

        assertOnMaster(flow);

        initialCommitAll(flow);
        FlowReleaseManager relman = getHotfixManager();

        ReleaseContext ctx = new ReleaseContext(projectRoot);
        ctx.setInteractive(false).setNoTag(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

        File projectRoot = projects.get(0).getBasedir();

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        ReleaseContext ctx = new ReleaseContext(projectRoot);
        ctx.setInteractive(false).setNoTag(true);

        flow.hotfixStart("1.0.1").call();

        assertOnHotfix(flow);
View Full Code Here

        }
    }

    protected void writeReportHeader() throws JGitFlowException
    {
        ReleaseContext ctx = contextProvider.getContext();
        JGitFlow flow = jGitFlowProvider.gitFlow();

        if (!headerWritten)
        {
            String mvnVersion = runtimeInformation.getApplicationVersion().toString();
            Package mvnFlowPkg = getClass().getPackage();
            String mvnFlowVersion = mvnFlowPkg.getImplementationVersion();

            String shortName = getClass().getSimpleName();

            flow.getReporter().debugText(shortName, "# Maven JGitFlow Plugin")
                .debugText(shortName, JGitFlowReporter.P)
                .debugText(shortName, "  ## Configuration")
                .debugText(shortName, JGitFlowReporter.EOL)
                .debugText(shortName, "    Maven Version: " + mvnVersion)
                .debugText(shortName, JGitFlowReporter.EOL)
                .debugText(shortName, "    Maven JGitFlow Plugin Version: " + mvnFlowVersion)
                .debugText(shortName, JGitFlowReporter.EOL)
                .debugText(shortName, "    args: " + ctx.getArgs())
                .debugText(shortName, "    base dir: " + ctx.getBaseDir().getAbsolutePath())
                .debugText(shortName, "    default development version: " + ctx.getDefaultDevelopmentVersion())
                .debugText(shortName, "    default feature name: " + ctx.getDefaultFeatureName())
                .debugText(shortName, "    default release version: " + ctx.getDefaultReleaseVersion())
                .debugText(shortName, "    release branch version suffix: " + ctx.getReleaseBranchVersionSuffix())
                .debugText(shortName, "    tag message: " + ctx.getTagMessage())
                .debugText(shortName, "    allow snapshots: " + ctx.isAllowSnapshots())
                .debugText(shortName, "    auto version submodules: " + ctx.isAutoVersionSubmodules())
                .debugText(shortName, "    enable feature versions: " + ctx.isEnableFeatureVersions())
                .debugText(shortName, "    enable ssh agent: " + ctx.isEnableSshAgent())
                .debugText(shortName, "    feature rebase: " + ctx.isFeatureRebase())
                .debugText(shortName, "    interactive: " + ctx.isInteractive())
                .debugText(shortName, "    keep branch: " + ctx.isKeepBranch())
                .debugText(shortName, "    no build: " + ctx.isNoBuild())
                .debugText(shortName, "    no deploy: " + ctx.isNoDeploy())
                .debugText(shortName, "    no tag: " + ctx.isNoTag())
                .debugText(shortName, "    pushFeatures: " + ctx.isPushFeatures())
                .debugText(shortName, "    pushReleases: " + ctx.isPushReleases())
                .debugText(shortName, "    pushHotfixes: " + ctx.isPushHotfixes())
                .debugText(shortName, "    squash: " + ctx.isSquash())
                .debugText(shortName, "    update dependencies: " + ctx.isUpdateDependencies())
                .debugText(shortName, "    use release profile: " + ctx.isUseReleaseProfile())
                .debugText(shortName, JGitFlowReporter.HR);

            flow.getReporter().flush();
            this.headerWritten = true;
        }
View Full Code Here

        }
    }

    private boolean setupUserPasswordCredentialsProvider() throws JGitFlowException
    {
        ReleaseContext ctx = contextProvider.getContext();
        JGitFlow flow = jGitFlowProvider.gitFlow();

        if (!Strings.isNullOrEmpty(ctx.getPassword()) && !Strings.isNullOrEmpty(ctx.getUsername()))
        {
            flow.getReporter().debugText(getClass().getSimpleName(), "using provided username and password");
            CredentialsProvider.setDefault(new UsernamePasswordCredentialsProvider(ctx.getUsername(), ctx.getPassword()));
        }
        else if (null != System.console())
        {
            flow.getReporter().debugText(getClass().getSimpleName(), "installing ssh console credentials provider");
            CredentialsProvider.setDefault(new ConsoleCredentialsProvider(prompter));
View Full Code Here

        return false;
    }

    private boolean setupSshCredentialsProvider() throws JGitFlowException
    {
        ReleaseContext ctx = contextProvider.getContext();
        JGitFlow flow = jGitFlowProvider.gitFlow();

        if (ctx.isEnableSshAgent())
        {
            flow.getReporter().debugText(getClass().getSimpleName(), "installing ssh-agent credentials provider");
            SshSessionFactory.setInstance(new SshCredentialsProvider(prompter));
            return true;
        }
View Full Code Here

    public void removeSnapshotFromPomVersions(ProjectCacheKey cacheKey, final String versionSuffix, List<MavenProject> reactorProjects) throws MavenJGitFlowException
    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        getLogger().info("(" + fullBranchName + ") removing snapshot from pom versions...");
        ReleaseContext ctx = contextProvider.getContext();
       
        Map<String, String> originalVersions = versionProvider.getOriginalVersions(cacheKey, reactorProjects);

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

        doUpdate(reactorProjects, originalVersions, finalVersions, ctx.isUpdateDependencies());
    }
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.