You can locate your persistence.xml into a a location like src/main/resources/PATH and use the filtering option to filter your persistence.xml and put into the correct location. This can be achieved by activating the filtering in resources like this:
<resource>
<directory>src/main/resources/PATH</directory>
<filtering>true</filtering>
</resource>
The same for your test resources:
<testResources>
<testResource>
<directory>src/main/resources/PATH</directory>
<filtering>true</filtering>
</testResource>
</testResources>
Based on the above you can give things like this 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 (i can remember something like META-INF/.. ? If yes that put it into src/main/resources/META-INF and change the filter directory accordingly.