I have created a xml file with specific configuration for my jndi datasource, like this:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<New id="MyDB" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/MyDB</Arg>
<Arg>
<New class="com.mysql.cj.jdbc.MysqlConnectionPoolDataSource">
<Set name="url">******</Set>
<Set name="user">******</Set>
<Set name="password">******</Set>
</New>
</Arg>
</New>
</Configure>
Dropped this file on $JETTY_BASE/etc but Jetty doesn't seem to be able to read the file to configure the datasource. However, if i pick the "New" tag and copy it to the jetty.xml file, it works.
I want this in a separate file so it makes easier for deploying to production and also to use this file in jetty-maven-plugin.
Is this possible? What am I doing wrong?