I am trying to add a library to my shrinkwrap deployment using the Maven resolver, but if the pom.xml is defined with a namespace (<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">) then I get the following error:
Caused by: java.lang.IllegalArgumentException: Bad artifact coordinates ::jar:, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
The reason is that the xpath, e.g. /project/artifactId, returns empty as it doesn't match the namespace. If I remove the namespace in my pom then it works but fails later when it hits another pom with namespace due to the transitivity.
The specific part of the code where I use the resolver look like this:
It does seem odd that the namespace makes it fail, so I wounder what I am missing?
I have found that if I have SaxonHE on the classpath then the above problem occurs. That is a problem since I have a component which does XSLT 2.0 transformations and hence needs SaxonHE.
Is there a way to work around this?