I am using JBoss Shrinkwrap 3.1.4 to resolve dependencies for given Maven coordinates. To achieve this, the following code is doing a fine job in most cases:
var artifacts = Maven.configureResolver()
.withClassPathResolution(false)
.loadPomFromFile(f)
.importCompileAndRuntimeDependencies()
.resolve()
.withTransitivity()
.asResolvedArtifact();
However, in some cases Shrinkwrap is not able to build the POM model and identifies validation problems in the POM file. For example, for javax.mail:mail:1.4.3, I get the following error message:
org.jboss.shrinkwrap.resolver.api.InvalidConfigurationFileException: Found 4 problems while building POM model from /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
1/ [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
2/ [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom 3/ [WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
4/ [ERROR] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin must be a valid version but is 'RELEASE'. @ javax.mail:mail:1.4.3, /root/.m2/repository/javax/mail/mail/1.4.3/mail-1.4.3.pom
I am only interested in the dependencies... these problems in the build section (like error 4) are irrelevant for me. I am wondering, if it is somehow possible to reduce validation strictness when processing the POM files (or disable it altogether), but I could not find anything in the APIs.
Any pointer would be appreciated.
best Sebastian