You can find your persistence.xml as a location, for example src / main / resources / PATH, and use the filter option to filter your persistence.xml and paste into the correct location. This can be achieved by activating filtering in resources such as this:
<resource> <directory>src/main/resources/PATH</directory> <filtering>true</filtering> </resource>
The same goes for your test resources:
<testResources> <testResource> <directory>src/main/resources/PATH</directory> <filtering>true</filtering> </testResource> </testResources>
Based on the above, you can pass such things in your persistence.xml
<hibernate.url>${database.url}</hibernate.url>
What you need to check is the correct target location of the persistence.xml file (can I recall something like META-INF / ..? If so, put it in src / main / resources / META-INF and change accordingly.
source share