The problem with com.atlassian.plugins.rest.api.multipart
is that it is not also compatible with Confluence 8.9 or 7.19.
However, Scott Dudley gave me a hint which led to the solution: If I avoid using the <rest-migration>
module in atlassian-plugin.xml, then C8.9 uses the old REST and C9.0 uses the new REST, and no importation error happens. I’ve written up my implementation here.