What's the advantage of using package-info.json vs. Export-Packages to define models to export Models?
Recently I encountered a project with a complex model package structure and looked into how best to support this. I found documentation at WCM.io that indicated this.
<!-- Export all non-internal packages by default -->
Export-Package: !*.impl.*,!*.internal.*,\ io.wcm.samples.*
Replace io.wcm.samples.* with the topmost package from your project.
That got me wondering what the advantage was of using syntax like this vs. simply dropping package-info.json files into all of the folders that contained models.
Additionally in the WCM.io documentation it mentions that for bnd plugin implementations Sling-Model-Packages should be moved into bnd configuration.
<configuration>
<bnd>
Sling-Initial-Content: SLING-INF/app-root;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/wcm-io/wcm/commons
Sling-Model-Packages: io.wcm.wcm.commons
Sling-Namespaces: wcmio=http://wcm.io/ns
Import-Package: \
<!-- For build compatibility with Java 11 -->\
javax.annotation;version="[0.0,2)",\
*
</bnd>
</configuration>Similarly why use this syntax vs just using the ModelScanner?