How to pass dependencies using different versions of Maven of the same name at the same time

my Maven dependency tree is as follows

Self
+- A
|  \- C 2.x
\- B
   \- C 3.x

the project relies on two libraries of AMagi B, which uses different versions of the C library, and the reference to C is necessary, and the two versions are not compatible with each other

how do I resolve this dependency conflict?

Mar.18,2021

you can simply screen A to avoid dependence on C, using the following method

<dependency>
            <groupId>A</groupId>
            <artifactId>A</artifactId>
            <version>1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>C</groupId>
                    <artifactId>C</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

but if A's dependence on C is necessary and incompatible, there is no good way but to repackage or upgrade with source code.
maybe modules or microservices are a direction, but they are too heavy.


Brother, have you found any reasonable solutions? I happen to encounter this problem at the same time. I'd like to ask

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9e84e-2f40e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9e84e-2f40e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?