开发者

What is the best way to get database password to integration tests using Maven?

We are using Maven and Spring and current execute our tests by using Sy开发者_JAVA技巧stem properties and test with this line.

mvn -Ddbuser=username -Ddbpassword=password test

In the past I had utilized environment variables but I read that support was going away in maven so figured it may be a bad practice.


You could store the password as property in the settings.xml file. Now, if storing it in a clear text bugs you as much as me, there is the --encrypt-password option for the maven that you can then store the password in the settings.xml encrypted in a profile, server, or some other section for use in your integration tests. Here's the link to the documentation on how to configure this:

http://maven.apache.org/guides/mini/guide-encryption.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜