javax.xml.stream.XMLInputFactory: Provider org.eclipse.osgi.technology.shaded.wstx.stax.WstxInputFactory not found#23
Conversation
…ng WstxInputFactory and WstxEventFactory to be minimised, even though they are referenced in META-INF/services
|
Thank you for the detailed bug report. I think that it's likely that we need to configure the Are you able to provide an example of an artifact for which this failure occurs? It would be useful to get a failing test case together so that we can successfully test a fix. |
|
For a simple test case if you clone The error occurs when the Feature Launcher tries to install the |
|




This is a rather specific workflow, where if you are loading an artifact (via the
MavenRepository), and the artifact is a version of RELEASE, LATEST or -SNAPSHOT (logic inDefaultVersionResolver.resolveVersion) and containsmaven-metadata.xml, then during resolution inorg.apache.maven.repository.internal.DefaultVersionResolver.readVersionsit will instantiate a MetadataStaxReader and then read.The first thing read does is:
XMLInputFactory factory = XMLInputFactory.newFactory();However due to the use of the maven.shading plugin with minimize = true the shaded output classes don't include the
WstxInputFactory.Even though in
META-INF/services/javax.xml.stream.XMLInputFactoryis:org.eclipse.osgi.technology.shaded.wstx.stax.WstxInputFactoryI played around with the maven.shading plugin quite a bit, but I couldn't figure out how to configure it to not minimise the WstxInputFactory. So the result is my heavy-handed solution to just hard-code a reference 🤦♂️
Just for reference the is my stacktrace i was dealing with: