javax.xml.stream.XMLInputFactory: Provider org.eclipse.osgi.technology.shaded.wstx.stax.WstxInputFactory not found #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




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: