At module level add the option to specify the dependencies from the userlib directory. This way the modeler knows when exporting a module which jar files to export. But when updating a module the modeler knows which files from the userlib are obsolete. Obsolete data from the userlib directory can be removed to prevent errors.
Apache Ivy may be acceptable but need documentation.
Gradle or Maven is another solution.
We are looking into how we can improve this. For now you can use an ivy script to manage the jars included in the export of the module.
For an example of how to do this, see the AwsIotConnector on GitHub: https://github.com/mendix/MxAwsIotConnector
This project contains a specification of all dependencies in ivy.xml. To download all dependencies you can runivy.cmd, to download just the export dependencies run runviy-export.cmd