I want to encrypt a password with maven, from within a Java program. Basically, I want to achieve the equivalent of calling mvn --encrypt-password p4ssw0rd, but without dropping to the command line.
I've looked into Apache Maven Invoker. I've found setters on InvocationRequest for _some command line options, such as InvocationRequest.setShowVersion(..) for --show-version. But I can't find one for --encrypt-password.
Is there a way to do this, either with Apache Maven Invoker or another way? I do not want to drop to or call a command line directly, since I want to be platform independent.
How do I invoke mvn --encrypt-password p4ssw0rd from a Java program?