|
If I want to monitor *.xml and *.properties in webapp/WEB-INF and src/main/resources - do I have to specify anything or do I need something like the following:
<configuration> Thanks, Matt Hi Matt,
Here's the info on what files are scanned automatically by the plugin: So if your *.xml and *.properties files from src/main/resources get built and put into target/classes (as is normal) then you don't have to do anything special for them. On the other hand, only very specific files in WEB-INF are scanned, so if you want others then you'll have to add them as a scanTargetPattern, just as you've shown above. cheers If I setup a scanTargetPattern for /src/main/resources (*.xml and *.properties), will it be scanned and re-deployed when using jetty:run-war?
Matt,
Currently neither the jetty:run-war nor jetty:run-exploded targets support the scanTarget or scanTargetPattern configuration properties. In the case of jetty:run-war, the redeployment only re-occurs the war file changes (ie you've done a mvn package in some other window). For jetty:run-exploded, it redeploys if any of a certain set of files it looks for inside the exploded war file changes (again, you've done a mvn package). I can see that perhaps there's an argument for instrumenting the scanTarget stuff for run-exploded, but I'm not so sure about run:war. cheers |
||||||||||||||||||||||||||||||||||||||||||||
The solution is a little bit more verbose than your example, however it is in keeping with the style of other file lists in the pom, plus it gives the power of doing exclusions as well.
An example would look like:
<scanTargetPatterns>
<scanTargetPattern>
<directory>src/main/java</directory>
<includes>
<include>*/.properties</include>
<include>*/.xml</include>
</includes>
<excludes>
<exclude>**/particular.properties</exclude>
</excludes>
</scanTargetPattern>
</scanTargetPatterns>
This mechanism works alongside the existing <scanTargets> parameter.