I'm workin in on java project ( with maven) I have a file (env-dev-windows.vars) for config like this :
APPLICATION_LOG_DIR=C:DIRLOG
APPLICATION_BDD_URL=jdbc::PostgreSQL://localhost:5432/postgres
APPLICATION_USER=user_name
APPLICATION_PASSWD=passwd
...
in persistence.xml file instead of using the username and password like this :
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/test" />
<property name="javax.persistence.jdbc.user" value="postgres" />
<property name="javax.persistence.jdbc.password" value="James123" />
I want to replace them with
System.getProperty("APPLICATION_USER")
and System.getProperty("APPLICATION_PASSWD")
I just want to use the Application properties and not for exemple ( the windows env variables defined in a local machine (in the parameters of a machine)
Is this possible ? for the moment I have no idea how to do it? is there another alternative
question from:
https://stackoverflow.com/questions/66065806/how-can-i-use-system-getproperty-in-persistence-xml-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…