spring - Decrypt password in pom.xml -
i have util class picks properties application.properties
(jdbc password in encrypted format in it) file , encrypts/decrypts
it. there way decrypt
password while using placeholders in pom.xml
for, decrypt password in pom.xml
need create create master password below commands :
mvn --encrypt-master-password
once run command then, create file called ~/.m2/settings-security.xml
, write below content file :
<settingssecurity> <master><!-- result of above command --></master> </settingssecurity>
after encrypt password rum below commands :
mvn --encrypt-password
after running command output, need create file /.m2/settings.xml
, write output in maven settings ~/.m2/settings.xml
. can use below sample code write /.m2/settings.xml
.
<settings> ... <servers> ... <server> <id>test.server</id> <username><!-- database username --></username> <password><!-- encrypted password --></password> </server> ... </servers> ... </settings>
for more can refer this link.
use below sql-maven-plugin
configuration pom.xml
.
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>sql-maven-plugin</artifactid> <version>3.0.0-snapshot</version> <!-- 3.0.0-snapshot required --> <configuration> <settingskey>test.server</settingskey> <!-- id of server here --> <driver>oracle.jdbc.driver.oracledriver</driver> <url>jdbc:oracle:thin:@ip.com:1521:sid</url> <!-- username , password not mentioned anymore --> </configuration> </plugin>
Comments
Post a Comment