I would like to use Maven’s password encryption such as it uses for nodes for properties of a Mojo. I tried just pasting an encrypted password into the correct property for the mojo, but it treated it as plain text. I was hoping there was an attribute I could set on the annotation for the Mojo property that would explain that it could be encrypted, and if so, to use the system master password to decrypt, but I don’t see anything in the documentation for that.
Has anybody managed to use Maven’s password encryption for anything other than server password nodes? Would love to make this work for my Mojo.
Not a complete answer, but hopefully a pointer in the right direction…
The maven-scm-plugin, maven-release-plugin, and tomcat6-maven-plugin all allow for reading passwords from the
<servers>section of the${user.home}/.m2/settings.xmlfile.Perhaps if you look at the source code for those plugins/goals, you will find a Maven core or shared component that allows you to do what you want, and you may adapt it for your needs.