Use a Ignition driver module inside a custom module

Hi everyone,
I am trying to create a Modbus device instance inside my module. Modbus driver is unavailable in Ignition Maven repository at the moment. I found Modbus driver locates in “C:\Program Files\Inductive Automation\Ignition\data\jar-cache\com.inductiveautomation.opcua.drivers.modbus” directory. Then I tried to install this driver as a locally dependency into my custom module using Maven “mvn install:install-file” command.
From some previous posts, I know that there have been significant changes in Ignition packages. For example, Modbus uses DriverContext in “com.inductiveautomation.xopc.driver.api.Driver” in 7.9 version to create a new device. While new devices use DeviceContext in “com.inductiveautomation.ignition.gateway.opcua.server.api.DeviceContext” in 8.1 version to create their instances. You can see it in the figures below.

When I tried to create an instance of Modbus device using my custom DriverContext instance, the Gateway said “DriverContext class not found”. Therefore, I have to cast my DeviceContext to DriverContext but I am not confident about it.

I know it isn’t a good practice to create a Modbus device in my module cause I have to simulate a lot of things on my own. For example, I am not sure how to initialize the instances of DriverContext, Device Context and DeviceSettingRecords,etc correctly. But I really want to figure out how it works.

Thank you for your precious time!