public Boolean getInteractiveMode() { return Boolean.valueOf( isInteractiveMode() ); }
if ( settings.isInteractiveMode() != true ) serializer.startTag( NAMESPACE, "interactiveMode" ).text( String.valueOf( settings.isInteractiveMode() ) ).endTag( NAMESPACE, "interactiveMode" );
public Boolean getInteractiveMode() { return Boolean.valueOf( isInteractiveMode() ); }
request.setInteractiveMode( settings.isInteractiveMode() );
/** * @param settings could be null * @return a new instance of settings or null if settings was null. */ public static Settings copySettings( Settings settings ) { if ( settings == null ) { return null; } Settings clone = new Settings(); clone.setActiveProfiles( settings.getActiveProfiles() ); clone.setInteractiveMode( settings.isInteractiveMode() ); clone.setLocalRepository( settings.getLocalRepository() ); clone.setMirrors( settings.getMirrors() ); clone.setModelEncoding( settings.getModelEncoding() ); clone.setOffline( settings.isOffline() ); clone.setPluginGroups( settings.getPluginGroups() ); clone.setProfiles( settings.getProfiles() ); clone.setProxies( settings.getProxies() ); clone.setServers( settings.getServers() ); clone.setSourceLevel( settings.getSourceLevel() ); clone.setUsePluginRegistry( settings.isUsePluginRegistry() ); return clone; } }
request.setInteractiveMode( settings.isInteractiveMode() );
if ( settings.isInteractiveMode() != true ) serializer.startTag( NAMESPACE, "interactiveMode" ).text( String.valueOf( settings.isInteractiveMode() ) ).endTag( NAMESPACE, "interactiveMode" );
public static MavenPluginQueryer getQueryer(Settings settings, Log log) { return (settings != null && !settings.isInteractiveMode()) ? new MavenPluginQueryerBatchModeDefaultImpl(log) : new MavenPluginQueryerDefaultImpl(log); } }
public static MavenPluginQueryer getQueryer(Settings settings, Log log) { return (settings != null && !settings.isInteractiveMode()) ? new MavenPluginQueryerBatchModeDefaultImpl(log) : new MavenPluginQueryerDefaultImpl(log); } }
protected void prepareFunctionName() throws MojoFailureException { info("Common parameter [Function Name]: name for both the new function and Java class"); if (settings != null && !settings.isInteractiveMode()) { assureInputInBatchMode(getFunctionName(), str -> isNotEmpty(str) && str.matches(FUNCTION_NAME_REGEXP), this::setFunctionName, true); } else { assureInputFromUser("Enter value for Function Name: ", getFunctionName(), str -> isNotEmpty(str) && str.matches(FUNCTION_NAME_REGEXP), "Function name must start with a letter and can contain letters, digits, '_' and '-'", this::setFunctionName); } }
@Override public void execute(ExecutionContext context) throws MojoExecutionException, MojoFailureException { this.log.info("Calculating required versions for all modules."); for (MavenProject project : this.reactorProjects) { this.log.info("\tVersions of module " + ProjectToString.EXCLUDE_VERSION.apply(project) + ":"); ArtifactCoordinates preReleaseCoordinates = this.metadata .getArtifactCoordinatesByPhase(project.getGroupId(), project.getArtifactId()).get(ReleasePhase.PRE_RELEASE); this.log.info("\t\t" + ReleasePhase.PRE_RELEASE + " = " + preReleaseCoordinates.getVersion()); Optional<Prompter> prompterToUse = this.settings.isInteractiveMode() ? Optional.of(this.prompter) : Optional.<Prompter> absent(); String releaseVersion = calculateReleaseVersion(project.getVersion(), prompterToUse); ArtifactCoordinates releaseCoordinates = new ArtifactCoordinates(project.getGroupId(), project.getArtifactId(), releaseVersion, PomUtil.ARTIFACT_TYPE_POM); this.metadata.addArtifactCoordinates(releaseCoordinates, ReleasePhase.RELEASE); this.log.info("\t\t" + ReleasePhase.RELEASE + " = " + releaseVersion); String nextDevVersion = calculateDevelopmentVersion(project.getVersion(), prompterToUse); ArtifactCoordinates postReleaseCoordinates = new ArtifactCoordinates(project.getGroupId(), project.getArtifactId(), nextDevVersion, PomUtil.ARTIFACT_TYPE_POM); this.metadata.addArtifactCoordinates(postReleaseCoordinates, ReleasePhase.POST_RELEASE); this.log.info("\t\t" + ReleasePhase.POST_RELEASE + " = " + nextDevVersion); } }
@Override public void execute(ExecutionContext context) throws MojoExecutionException, MojoFailureException { this.log.info("Calculating required versions for all modules."); for (MavenProject project : this.reactorProjects) { this.log.info("\tVersions of module " + ProjectToString.EXCLUDE_VERSION.apply(project) + ":"); ArtifactCoordinates preReleaseCoordinates = this.metadata .getArtifactCoordinatesByPhase(project.getGroupId(), project.getArtifactId()).get(ReleasePhase.PRE_RELEASE); this.log.info("\t\t" + ReleasePhase.PRE_RELEASE + " = " + preReleaseCoordinates.getVersion()); Optional<Prompter> prompterToUse = this.settings.isInteractiveMode() ? Optional.of(this.prompter) : Optional.<Prompter> absent(); String releaseVersion = calculateReleaseVersion(project.getVersion(), prompterToUse); ArtifactCoordinates releaseCoordinates = new ArtifactCoordinates(project.getGroupId(), project.getArtifactId(), releaseVersion, PomUtil.ARTIFACT_TYPE_POM); this.metadata.addArtifactCoordinates(releaseCoordinates, ReleasePhase.RELEASE); this.log.info("\t\t" + ReleasePhase.RELEASE + " = " + releaseVersion); String nextDevVersion = calculateDevelopmentVersion(project.getVersion(), prompterToUse); ArtifactCoordinates postReleaseCoordinates = new ArtifactCoordinates(project.getGroupId(), project.getArtifactId(), nextDevVersion, PomUtil.ARTIFACT_TYPE_POM); this.metadata.addArtifactCoordinates(postReleaseCoordinates, ReleasePhase.POST_RELEASE); this.log.info("\t\t" + ReleasePhase.POST_RELEASE + " = " + nextDevVersion); } }
protected void preparePackageName() throws MojoFailureException { info("Common parameter [Package Name]: package name of the new Java class"); if (settings != null && !settings.isInteractiveMode()) { assureInputInBatchMode(getFunctionPackageName(), str -> isNotEmpty(str) && isName(str), this::setFunctionPackageName, true); } else { assureInputFromUser("Enter value for Package Name: ", getFunctionPackageName(), str -> isNotEmpty(str) && isName(str), "Input should be a valid Java package name.", this::setFunctionPackageName); } }
protected FunctionTemplate getFunctionTemplate(final List<FunctionTemplate> templates) throws Exception { info(""); info(FIND_TEMPLATE); if (settings != null && !settings.isInteractiveMode()) { assureInputInBatchMode(getFunctionTemplate(), str -> getTemplateNames(templates) .stream() .filter(Objects::nonNull) .anyMatch(o -> o.equalsIgnoreCase(str)), this::setFunctionTemplate, true); } else { assureInputFromUser("template for new function", getFunctionTemplate(), getTemplateNames(templates), this::setFunctionTemplate); } return findTemplateByName(templates, getFunctionTemplate()); }
private String getNextSnapshotVersion(String currentVersion) throws MojoFailureException, VersionParseException { // get next snapshot version final String nextSnapshotVersion; if (!settings.isInteractiveMode() && StringUtils.isNotBlank(developmentVersion)) { nextSnapshotVersion = developmentVersion; } else { GitFlowVersionInfo versionInfo = new GitFlowVersionInfo( currentVersion); if (digitsOnlyDevVersion) { versionInfo = versionInfo.digitsVersionInfo(); } nextSnapshotVersion = versionInfo .nextSnapshotVersion(versionDigitToIncrement); } if (StringUtils.isBlank(nextSnapshotVersion)) { throw new MojoFailureException( "Next snapshot version is blank."); } return nextSnapshotVersion; }
/** * Method updateSettings. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateSettings(Settings value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "localRepository", value.getLocalRepository(), null); findAndReplaceSimpleElement(innerCount, root, "interactiveMode", value.isInteractiveMode() == true ? null : String.valueOf( value.isInteractiveMode() ), "true"); findAndReplaceSimpleElement(innerCount, root, "usePluginRegistry", value.isUsePluginRegistry() == false ? null : String.valueOf( value.isUsePluginRegistry() ), "false"); findAndReplaceSimpleElement(innerCount, root, "offline", value.isOffline() == false ? null : String.valueOf( value.isOffline() ), "false"); iterateProxy(innerCount, root, value.getProxies(),"proxies","proxy"); iterateServer(innerCount, root, value.getServers(),"servers","server"); iterateMirror(innerCount, root, value.getMirrors(),"mirrors","mirror"); iterateProfile(innerCount, root, value.getProfiles(),"profiles","profile"); findAndReplaceSimpleLists(innerCount, root, value.getActiveProfiles(), "activeProfiles", "activeProfile"); findAndReplaceSimpleLists(innerCount, root, value.getPluginGroups(), "pluginGroups", "pluginGroup"); } //-- void updateSettings(Settings, String, Counter, Element)
/** * Method updateSettings * * @param value * @param element * @param counter * @param xmlTag */ protected void updateSettings(Settings value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "localRepository", value.getLocalRepository(), null); findAndReplaceSimpleElement(innerCount, root, "interactiveMode", value.isInteractiveMode() == true ? null : String.valueOf( value.isInteractiveMode() ), "true"); findAndReplaceSimpleElement(innerCount, root, "usePluginRegistry", value.isUsePluginRegistry() == false ? null : String.valueOf( value.isUsePluginRegistry() ), "false"); findAndReplaceSimpleElement(innerCount, root, "offline", value.isOffline() == false ? null : String.valueOf( value.isOffline() ), "false"); iterateProxy(innerCount, root, value.getProxies(),"proxies","proxy"); iterateServer(innerCount, root, value.getServers(),"servers","server"); iterateMirror(innerCount, root, value.getMirrors(),"mirrors","mirror"); iterateProfile(innerCount, root, value.getProfiles(),"profiles","profile"); findAndReplaceSimpleLists(innerCount, root, value.getActiveProfiles(), "activeProfiles", "activeProfile"); findAndReplaceSimpleLists(innerCount, root, value.getPluginGroups(), "pluginGroups", "pluginGroup"); } //-- void updateSettings(Settings, String, Counter, Element)
@Override public void execute() throws MojoExecutionException, MojoFailureException { ReleaseContext ctx = new ReleaseContext(getBasedir()); ctx.setInteractive(getSettings().isInteractiveMode()) .setNoDeploy(false) .setEnableFeatureVersions(true) .setFlowInitContext(getFlowInitContext().getJGitFlowContext()); try { releaseManager.deploy(ctx, getReactorProjects(), session, buildNumber, goals); } catch (JGitFlowReleaseException e) { throw new MojoExecutionException("Error finishing feature: " + e.getMessage(),e); } } }
@Override public void execute() throws MojoExecutionException, MojoFailureException { ReleaseContext ctx = new ReleaseContext(getBasedir()); ctx.setInteractive(getSettings().isInteractiveMode()) .setDefaultFeatureName(featureName) .setEnableFeatureVersions(enableFeatureVersions) .setEnableSshAgent(enableSshAgent) .setAllowUntracked(allowUntracked) .setPushFeatures(pushFeatures) .setStartCommit(startCommit) .setAllowRemote(isRemoteAllowed()) .setDefaultOriginUrl(defaultOriginUrl) .setScmCommentPrefix(scmCommentPrefix) .setFlowInitContext(getFlowInitContext().getJGitFlowContext()); try { releaseManager.start(ctx,getReactorProjects(),session); } catch (JGitFlowReleaseException e) { throw new MojoExecutionException("Error starting feature: " + e.getMessage(),e); } } }
@Override public void execute() throws MojoExecutionException, MojoFailureException { ReleaseContext ctx = new ReleaseContext(getBasedir()); ctx.setAutoVersionSubmodules(autoVersionSubmodules) .setInteractive(getSettings().isInteractiveMode()) .setDefaultReleaseVersion(releaseVersion) .setAllowSnapshots(allowSnapshots) .setUpdateDependencies(updateDependencies) .setEnableSshAgent(enableSshAgent) .setAllowUntracked(allowUntracked) .setPushHotfixes(pushHotfixes) .setStartCommit(startCommit) .setAllowRemote(isRemoteAllowed()) .setDefaultOriginUrl(defaultOriginUrl) .setScmCommentPrefix(scmCommentPrefix) .setFlowInitContext(getFlowInitContext().getJGitFlowContext()); try { releaseManager.start(ctx,getReactorProjects(),session); } catch (JGitFlowReleaseException e) { throw new MojoExecutionException("Error starting hotfix: " + e.getMessage(),e); } } }