Use encrypted data in a Maven pom

后端 未结 3 956
别那么骄傲
别那么骄傲 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: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).

提交回复
热议问题