问题
Requirement:
We have JBoss EAP 6.2. In standalone.xml, we have datasource configured. Our requirement is that we do not want username and password in standalone.xml.
Username and password are received from some external system call.
So, is there any custom way to provide username and password to JBoss from this our external system?
回答1:
You can provide dynamic values in standalone.xml using server startup parameters eg.
<security>
<user-name>${datasource.username}</user-name>
<password>${datasource.password}</password>
</security>
values can be set in standalone.conf (eg. -Ddatasource.username=$SOME_VAR
) which could come from environment variables set in a bash script from your external call
Or you can use the CLI to add a datasource manually, use the following CLI command to get a list of commands:
data-source add --help
note however this wont bypass standalone.xml as the username/password will still be added to the xml file
来源:https://stackoverflow.com/questions/30747466/jboss-eap-6-2-how-to-configure-datasource-username-password-to-be-dynamic