Asks the user a question on the console. This is what an interactive Maven plugin uses to prompt — the archetype plugin's "Define value for property…" comes from here.
Prompter handles the common cases: a plain question, a question with a default, a question restricted to
a list of allowed answers, and a password prompt that does not echo. InputHandler and OutputHandler are
the lower-level pieces underneath.
Maintained, quietly. The API is small and settled; expect dependency updates rather than new features.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity-api</artifactId>
<version>1.5.1</version>
</dependency>Check the badge above for the current version. Note the artifact is plexus-interactivity-api;
plexus-interactivity is the aggregator.
@Inject
Prompter prompter;
String name = prompter.prompt( "Project name" );
String scope = prompter.prompt( "Scope", List.of( "compile", "test" ), "compile" );
String secret = prompter.promptForPassword( "Password" );A plugin that prompts should check MavenSession.getRequest().isInteractiveMode() first, so it does not
hang a batch-mode build.
Java 8 or later.
See CONTRIBUTING.md. In short:
mvn verify builds, and run mvn spotless:apply before pushing or CI will fail on formatting.
Please report security vulnerabilities privately — see SECURITY.md, not a public issue.