2
votes

I am using maven-jetty plugin and when I use jetty to run a webapp, the webapp does not look in the target/test-classes directory at all for a resource. However, it can find resources in the target/classes directory.

Here is the relevant part of my pom.xml

<configuration>
 <webApp>target/webapp.war</webApp> 
 <testClassesDirectory>target/test-classes/</testClassesDirectory> 
 <useTestClasspath>true</useTestClasspath> 
 <stopPort>9966</stopPort> 
 <stopKey>stopKey</stopKey> 
</configuration> 

How can I make the maven-jetty plugin look in target/test-classes for resources

1

1 Answers

1
votes

Because /src/test/java and /src/test/resources folders are only intended for unit testing. They are not added to maven-jetty-plugin CLASSPATH nor they are included in resulting WAR.