From Spring 3.1 (i think) you can use also the packagesToScan property, which accepts wildcards. It just doesn't work with elements without the @XmlRootElement
annotation, just like the contextPath property. These need generated object-factory.
Could look like:
com.test.*
com.*.test