According to the Oracle documentation for Building, Packaging, and Deploying RESTful Web Service Applications there is a parameter jersey.config.server.provider.scanning.recursive
that can be used to modify the servlets configurations.
Example of web.xml file if a class that extends javax.ws.rs.core.Application
is not packaged. This is for Pre-3.0 Servlets:
<web-app>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.foo.myresources,org.bar.otherresources</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.scanning.recursive</param-name>
<param-value>false</param-value>
</init-param>
...
</servlet>
...
</web-app>
Now, there is not any documentation explaining exactly what does this parameter does and how to use it.
Question:
So, what should I take into consideration regarding the jersey.config.server.provider.scanning.recursive
parameter when Building, Packaging, and Deploying RESTful Web Service Applications?
Inside the jersey github project (jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108) there is a formal description for this property:
Sets the recursion strategy for package scanning.
The value of
true
indicates that the list of provided package names should be scanned recursively including any nested packages. Value offalse
indicates that only packages in the list should be scanned. In such case any nested packages will be ignored.The property value MUST be an instance of
Boolean
type or aString
convertible toBoolean
type.A default value is
true
.