While generating java code from Avro scheme using commerce hub Gradle plugin, it takes the object which has a field such as
"name": "ruleKey",
"type": [
"null",
{
"type": "enum",
"name": “Rule”,
"namespace": "com.testing.common.rules.api",
"symbols": [
"MIN_AGE",
“MAX_AGE”
]
}
]
, and generates Java class from the scheme, including enum fields such as Rule. In the same time, I am importing common rules(com.testing.common.rules.api) and it imports Rule as well. I would like to use methods from the common library, however, Avro generated model has a higher priority. ( The Java interpreter will look for classes in the directories in the order they appear in the classpath variable. In this case, the ones generated from the scheme) and it doesn’t let me use the imported class from the common library, because Avro already generated Rule enum class with the same package and name.
The used technologies are spring boot 2, Java 10 and commercehub.gradle plugin.