Skip to content
Advertisement

Error when using the maven-plugin-plugin version 3.6.0 on Java 16 code containing record types

I’m creating a Maven plugin using

JavaScript

I’d like to upgrade the required JDK version of my plugin and its dependencies to 16, but there seems to be a problem:

JavaScript

In org.apache.maven.plugin-tools:maven-plugin-tools-annotations:3.6.0, the following constructor can be seen (which is invoked in DefaultMojoAnnotationsScanner.analyzeClassStream() from the stack trace):

JavaScript

It hard wires the ASM API version to ASM7, when ASM requires version 8 to process record types. Before a new version of these Maven plugins are released, is there any way I can upgrade the ASM dependency of the above class without forking and patching all possible Maven plugins? Using the usual <excludes> and <dependency> tags on the plugin doesn’t work here, because even if I upgrade the depency itself, the MojoClassVisitor still hard-codes the API version to ASM7.

I’ve also created https://issues.apache.org/jira/browse/MPLUGIN-371 to track this

Advertisement

Answer

It seems to be a recognised issue that has been fixed for the next version 3.6.1: https://issues.apache.org/jira/browse/MPLUGIN-369

A workaround is to add:

JavaScript

And then add this dependency to the maven-plugin-plugin:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement