I’m looking how to load my jndi.properties files which are in the test/resources folder when firing up jetty through maven. I’ve tried to do it with the extraClasspath and scannTargetPatterns but nothing works. below you’ll find the snippet of my pom that starts and stops jetty. The files are located at src/test/resources/jndi_folder/local_jndi.properties and src/test/resources/jndi_folder/remote_jndi.properties
The scanTargetPatterns pick them up since I get this output in my console:
[INFO] Adding extra scan target from pattern: services/src/test/resources/jndi_folder /local_jndi.properties
[INFO] Adding extra scan target from pattern: services/src/test/resources/jndi_folder/remote_jndi.properties
but when I run my integration test I get a nullpointer saying my code can’t find the .properties files.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webApp>
${basedir}/target/messages
</webApp>
<contextPath>
messages
</contextPath>
<stopKey>stop</stopKey>
<stopPort>8005</stopPort>
<daemon>true</daemon>
<scanTargetPatterns>
<scanTargetPattern>
<directory>
${basedir}/src/test/resources
</directory>
<includes>
<include>**/*.properties</include>
</includes>
</scanTargetPattern>
</scanTargetPatterns>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
if anyone can help me out that would be great.
Cheers
try adding the following into your configuration tag: