Use encrypted data in a Maven pom

后端 未结 3 929
别那么骄傲
别那么骄傲 2021-01-01 22:52

I know that it is possible to encrypt a password and put the encrypted data in the settings.xml, so that Maven can access a remote server (for deployment, etc.)

相关标签:
3条回答
  • 2021-01-01 23:30

    Maven provided the necessary support to encrypt passwords in settings.xml, and for plugins to retrieve them. See for example SqlExecMojo.java.

    Plugins "just" have to use this feature to be more user-friendly with credentials management.

    0 讨论(0)
  • 2021-01-01 23:35

    up to no I'm also only aware of the password encryption you mentioned. All other encryption must be handled by the plugin itself. Or by a plugin. It may be a solution to put the encryption keys in settings.xml and use the properties-plugin to load the properties from the file (or just as inspiration source) and some library like jasypt to create your own encryption plugin. You could configure the plugin which properties to decrypt and replace and bind it to an early phase in the maven lifecycle.

    I haven't seen something ready to use like this but it looks not too complicated.

    Jasypt is also used for the same purpose with the Spring PropertyPlaceholderconfigurer (encrypt date in .properties files).

    0 讨论(0)
  • 2021-01-01 23:50

    https://github.com/echocat/velma

    echocat Velma

    …is a Master-Password protected password safe for your maven passwords. These passwords are normally stored in .m2/settings.xml and could be protected by a master password in .m2/settings-security.xml. But this way is still dangerous because every person with access to your computer has access to your Master-Password.

    Maybe thats what your are looking for.

    0 讨论(0)
提交回复
热议问题