I'm using Hyperjaxb 3 with maven to generate java classes from an xsd. In order to specify the datasource used in the AS, I configured a custom persistence.xml template using the persistenceXml setting in the plugin-configuration (pom.xml)
<configuration>
<variant>jpa2</variant>
<persistenceXml>src/main/etc/persistence.xml</persistenceXml>
</configuration>
Here's the template:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="2.0">
<persistence-unit name="##generated">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Since there is no datasource when running the tests with maven, the roundtrip test fails. Is there a way to ignore the jta-data-source
option and fall back to persistence.properties, or to generate an alternative persistence.xml in src/test/resources
?