Currently if the application for example detects the XML parser used at runtime we put all the parsers it can possibly use to DEPEND and RDEPEND. I think it would be better to extend package.env so that java-config checks which ones are installed and puts those to classpath. On the gjl side this can be implemented using Java virtuals but that doesn't work on the DEPEND side because we require all of them installed to be able to build all the providers. This approach should be most useful if we ever get a binary repo setup.
Hmm. Should be implementable this way: for DEPEND use --build-only and then register runtime dep on the virtual. We should find out what all packages can benefit from this.
Has this been solved with the register-optional-dep functionality?