public boolean confirmConfiguration(ArchetypeConfiguration archetypeConfiguration) throws PrompterException { StringWriter buff = new StringWriter(); PrintWriter out = new PrintWriter(buff); out.println(ansi().a(INTENSITY_BOLD).a("Confirm archetype configuration").reset().a("...")); out.format(" %s=%s", Constants.ARCHETYPE_GROUP_ID, archetypeConfiguration.getGroupId()).println(); out.format(" %s=%s", Constants.ARCHETYPE_ARTIFACT_ID, archetypeConfiguration.getArtifactId()).println(); out.format(" %s=%s", Constants.ARCHETYPE_VERSION, archetypeConfiguration.getVersion()).println(); for (Map.Entry entry : archetypeConfiguration.getProperties().entrySet()) { out.format(" %s=%s", entry.getKey(), entry.getValue()).println(); } out.flush(); String answer = prompter.prompt(buff.toString(), "Y"); return "Y".equalsIgnoreCase(answer); }
public java.util.Properties toProperties () { java.util.Properties result = new java.util.Properties (); result.putAll ( properties ); result.setProperty ( Constants.ARCHETYPE_GROUP_ID, (org.codehaus.plexus.util.StringUtils.isNotEmpty( getGroupId () ) ? getGroupId () : "" ) ); result.setProperty ( Constants.ARCHETYPE_ARTIFACT_ID, (org.codehaus.plexus.util.StringUtils.isNotEmpty( getArtifactId () ) ? getArtifactId () : "" ) ); result.setProperty ( Constants.ARCHETYPE_VERSION, (org.codehaus.plexus.util.StringUtils.isNotEmpty( getVersion () ) ? getVersion () : "" ) ); properties.setProperty ( Constants.ARCHETYPE_POST_GENERATION_GOALS, (org.codehaus.plexus.util.StringUtils.isNotEmpty( getGoals() ) ? getGoals() : "" ) ); return result; }